plugin possible (but very unlikely) leak in proc_args if argc > 56 and pread error

This commit is contained in:
Doug MacEachern 2005-09-12 20:55:52 +00:00
parent 77e652803d
commit 9ec93a73ed
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}