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
if (!file)
return;
char buffer[256];
if (!fgets(buffer, 255, file)) {
return;
}
unsigned int oom;
int ok = sscanf(buffer, "%u", &oom);
if (ok >= 1) {
process->oom = oom;
if (fgets(buffer, 255, file)) {
unsigned int oom;
int ok = sscanf(buffer, "%u", &oom);
if (ok >= 1) {
process->oom = oom;
}
}
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