From cc4f93cf8f89cf78d50cd8293a995267ba6229a9 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 13 Jul 2005 15:58:07 +0000 Subject: [PATCH] plug possible fd leak if pgrab fails for proc_modules --- src/os/solaris/solaris_sigar.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 82ffb6e0..69486f72 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -975,12 +975,14 @@ static int sigar_pgrab_modules(sigar_t *sigar, sigar_pid_t pid, } if ((pstatus = sigar_init_libproc(sigar)) != SIGAR_OK) { + close(fd); return pstatus; } pstatus = sigar_pgrab(sigar, pid, SIGAR_FUNC, &phandle); if (pstatus != SIGAR_OK) { + close(fd); return pstatus; }