diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index ca544f3c..a0ba077b 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -528,11 +528,13 @@ int sigar_proc_list_get(sigar_t *sigar, } num = len/sizeof(*proc); - proclist->number = 0; - proclist->size = num; - proclist->data = malloc(sizeof(*(proclist->data)) * num); + sigar_proc_list_create(proclist); for (i=0; idata[proclist->number++] = proc[i].KI_PID; }