Commit 99bc2377 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Fix resource leak detected by cppcheck

parent af027497
...@@ -669,13 +669,12 @@ static void ProcessList_readOomData(Process* process, const char* dirname, const ...@@ -669,13 +669,12 @@ static void ProcessList_readOomData(Process* process, const char* dirname, const
if (!file) if (!file)
return; return;
char buffer[256]; char buffer[256];
if (!fgets(buffer, 255, file)) { if (fgets(buffer, 255, file)) {
return; unsigned int oom;
} int ok = sscanf(buffer, "%u", &oom);
unsigned int oom; if (ok >= 1) {
int ok = sscanf(buffer, "%u", &oom); process->oom = oom;
if (ok >= 1) { }
process->oom = oom;
} }
fclose(file); fclose(file);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment