From 9ec93a73ed718d97d3a92582016db4f10420d81d Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 12 Sep 2005 20:55:52 +0000 Subject: [PATCH] plugin possible (but very unlikely) leak in proc_args if argc > 56 and pread error --- src/os/solaris/solaris_sigar.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 1af582b5..7cb2ee0d 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -718,6 +718,9 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, if ((nread = pread(fd, argvp, argv_size, pinfo->pr_argv)) <= 0) { close(fd); + if (argvp != argvb) { + free(argvp); + } return errno; } @@ -733,6 +736,9 @@ int sigar_proc_args_get(sigar_t *sigar, sigar_pid_t pid, if ((nread = pread(fd, buffer, sizeof(buffer), (off_t)argvp[n])) <= 0) { close(fd); + if (argvp != argvb) { + free(argvp); + } return errno; }