Merge pull request #1702 from philippwiesemann/fix-lib-proc-file-closes

Fix not closing cmdline files from /proc/ on read errors (in master branch)
remotes/origin/falkon
David Rosca 11 years ago
commit a21c9a2ab4
  1. 4
      src/lib/3rdparty/processinfo.cpp

@ -85,12 +85,12 @@ pid_t ProcessInfo::GetPIDbyName(const char* cchrptr_ProcessName) const
if (fd_CmdLineFile) {
int r = fscanf(fd_CmdLineFile, "%20s", chrarry_NameOfProcess) ; // read from /proc/<NR>/cmdline
fclose(fd_CmdLineFile); // close the file prior to exiting the routine
if (r < 1) {
continue;
}
fclose(fd_CmdLineFile); // close the file prior to exiting the routine
if (strrchr(chrarry_NameOfProcess, '/')) {
chrptr_StringToCompare = strrchr(chrarry_NameOfProcess, '/') + 1 ;
}

Loading…
Cancel
Save