Commit 282f16c4 authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

fix memory leak

parent a600d5a6
...@@ -91,7 +91,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(int pid) { ...@@ -91,7 +91,10 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(int pid) {
break; break;
anyRead = true; anyRead = true;
char* entry = malloc(1024); char* entry = malloc(1024);
if (!fgets(entry, 1024, fd)) break; if (!fgets(entry, 1024, fd)) {
free(entry);
break;
}
char* newline = strrchr(entry, '\n'); char* newline = strrchr(entry, '\n');
*newline = '\0'; *newline = '\0';
if (cmd == 'f') { if (cmd == 'f') {
......
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