Merge branch 'jk/pstat_getfile2'
This commit is contained in:
parent
9774d05e20
commit
22dec9316c
|
@ -1983,6 +1983,7 @@ int sigar_file_system_list_get(sigar_t *sigar,
|
|||
fs = malloc(len);
|
||||
|
||||
if ((num = sigar_getfsstat(fs, len, MNT_NOWAIT)) < 0) {
|
||||
free(fs);
|
||||
return errno;
|
||||
}
|
||||
|
||||
|
@ -2026,6 +2027,7 @@ int sigar_file_system_list_get(sigar_t *sigar,
|
|||
sigar_fs_type_init(fsp);
|
||||
}
|
||||
|
||||
free(fs);
|
||||
return SIGAR_OK;
|
||||
}
|
||||
|
||||
|
@ -2445,8 +2447,10 @@ static int sigar_ifmsg_iter(sigar_t *sigar, ifmsg_iter_t *iter)
|
|||
case IFMSG_ITER_LIST:
|
||||
SIGAR_NET_IFLIST_GROW(iter->data.iflist);
|
||||
|
||||
/* sdl_data doesn't include a trailing \0, it is only sdl_nlen long */
|
||||
name = malloc(sdl->sdl_nlen+1);
|
||||
memcpy(name, sdl->sdl_data, sdl->sdl_nlen+1);
|
||||
memcpy(name, sdl->sdl_data, sdl->sdl_nlen);
|
||||
name[sdl->sdl_nlen] = '\0'; /* add the missing \0 */
|
||||
|
||||
iter->data.iflist->data[iter->data.iflist->number++] = name;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue