Browse Source

Avoid memory leak in wait4all (/proc mode)

develop
Damien Goutte-Gattat 9 years ago
parent
commit
9a363b2c0c
  1. 8
      src/wait4pid.c

8
src/wait4pid.c

@ -210,8 +210,10 @@ wait4all(pid_t *pids, size_t len)
continue;
if ( stat(paths + 20 * i, &st_buf) == -1 ) {
if ( errno != ENOENT )
return -1;
if ( errno != ENOENT ) {
nproc = -1;
break;
}
pids[i] = -1;
nproc -= 1;
@ -223,7 +225,7 @@ wait4all(pid_t *pids, size_t len)
free(paths);
return 0;
return nproc;
}
#endif /* ! HAVE_LINUX_NETLINK_H */

Loading…
Cancel
Save