Use strdup explicitly

This commit is contained in:
Hisham Muhammad
2011-12-25 20:23:53 +00:00
parent 93233a67ea
commit 81e44312b4
17 changed files with 38 additions and 36 deletions

View File

@ -617,7 +617,7 @@ static bool ProcessList_readCmdlineFile(Process* process, const char* dirname, c
command[amtRead] = '\0';
fclose(file);
free(process->comm);
process->comm = String_copy(command);
process->comm = strdup(command);
return true;
}
@ -710,11 +710,11 @@ static bool ProcessList_processEntries(ProcessList* this, const char* dirname, P
if (process->state == 'Z') {
free(process->comm);
process->comm = String_copy(command);
process->comm = strdup(command);
} else if (Process_isThread(process)) {
if (this->showThreadNames || Process_isKernelThread(process) || process->state == 'Z') {
free(process->comm);
process->comm = String_copy(command);
process->comm = strdup(command);
} else if (this->showingThreadNames) {
if (! ProcessList_readCmdlineFile(process, dirname, name))
goto errorReadingProcess;