mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-12-20 06:17:13 +01:00
daemon: fix file descriptor leaks
This commit is contained in:
@@ -50,7 +50,10 @@ enum GPUVendor gamemode_get_gpu_vendor(long device)
|
||||
return Vendor_Invalid;
|
||||
}
|
||||
char buff[64];
|
||||
if (fgets(buff, 64, file) != NULL) {
|
||||
bool got_line = fgets(buff, 64, file) != NULL;
|
||||
fclose(file);
|
||||
|
||||
if (got_line) {
|
||||
vendor = strtol(buff, NULL, 0);
|
||||
} else {
|
||||
LOG_ERROR("Coudn't read contents of file %s, will not apply optimisations!\n", path);
|
||||
|
||||
Reference in New Issue
Block a user