fix memory leak

This commit is contained in:
Hisham Muhammad 2010-03-03 21:10:51 +00:00
parent a600d5a6e9
commit 282f16c4b8
1 changed files with 4 additions and 1 deletions

View File

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