diff options
Diffstat (limited to 'libnetfs/fsys-get-children.c')
-rw-r--r-- | libnetfs/fsys-get-children.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libnetfs/fsys-get-children.c b/libnetfs/fsys-get-children.c index 6a038d23..4e78a8ca 100644 --- a/libnetfs/fsys-get-children.c +++ b/libnetfs/fsys-get-children.c @@ -40,7 +40,7 @@ netfs_S_fsys_get_children (struct netfs_control *fsys, mach_msg_type_number_t *controlsCnt) { error_t err; - char *n = NULL; + char *n = NULL, *orig_names = *names; size_t n_len = 0; mach_port_t *c; size_t c_count; @@ -62,7 +62,11 @@ netfs_S_fsys_get_children (struct netfs_control *fsys, (char **) controls, controlsCnt); c = NULL; /* c was freed by iohelp_return_malloced_buffer. */ if (err) - goto errout; + { + if (*names != *orig_names) + munmap (*names, n_len); + goto errout; + } *controlsPoly = MACH_MSG_TYPE_MOVE_SEND; *controlsCnt = c_count; |