proc_args_destroy if os_proc_args_get != SIGAR_OK

This commit is contained in:
Doug MacEachern 2010-04-21 13:48:10 -07:00
parent c9ef9f4bb6
commit bbc21090a1
1 changed files with 6 additions and 1 deletions

View File

@ -373,8 +373,13 @@ SIGAR_DECLARE(int) sigar_proc_args_get(sigar_t *sigar,
sigar_pid_t pid,
sigar_proc_args_t *procargs)
{
int status;
sigar_proc_args_create(procargs);
return sigar_os_proc_args_get(sigar, pid, procargs);
status = sigar_os_proc_args_get(sigar, pid, procargs);
if (status != SIGAR_OK) {
sigar_proc_args_destroy(sigar, procargs);
}
return status;
}
int sigar_file_system_list_create(sigar_file_system_list_t *fslist)