plug possible fd leak if pgrab fails for proc_modules
This commit is contained in:
parent
5b5f4bf48f
commit
cc4f93cf8f
|
@ -975,12 +975,14 @@ static int sigar_pgrab_modules(sigar_t *sigar, sigar_pid_t pid,
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pstatus = sigar_init_libproc(sigar)) != SIGAR_OK) {
|
if ((pstatus = sigar_init_libproc(sigar)) != SIGAR_OK) {
|
||||||
|
close(fd);
|
||||||
return pstatus;
|
return pstatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
pstatus = sigar_pgrab(sigar, pid, SIGAR_FUNC, &phandle);
|
pstatus = sigar_pgrab(sigar, pid, SIGAR_FUNC, &phandle);
|
||||||
|
|
||||||
if (pstatus != SIGAR_OK) {
|
if (pstatus != SIGAR_OK) {
|
||||||
|
close(fd);
|
||||||
return pstatus;
|
return pstatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue