dont use format string if an error occures

This commit is contained in:
Linus Dierheimer
2021-04-03 21:51:50 +02:00
parent 67465d266e
commit e01d03f98d
13 changed files with 198 additions and 152 deletions
+4 -2
View File
@@ -10,7 +10,7 @@ void ffPrintMemory(FFinstance* instance)
}
char* line = NULL;
size_t len;
size_t len = 0;
uint32_t total, shared, memfree, buffers, cached, reclaimable;
@@ -23,7 +23,9 @@ void ffPrintMemory(FFinstance* instance)
sscanf(line, "SReclaimable: %u", &reclaimable);
}
free(line);
if(line != NULL)
free(line);
fclose(meminfo);
uint32_t used_mem = (total + shared - memfree - buffers - cached - reclaimable) / 1024;