summaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 11:25:04 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-01-01 11:25:11 +0100
commitb6a238ea84aa8c7e07b906669cd279f901e7d137 (patch)
treefe385a100a0965c6c8ae639ddb377114c604178c /libnetfs
parent6ab707e575fefa32c039ce5f815e4859b6cd1d47 (diff)
fsys_get_children: Fix double-free on error
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/fsys-get-children.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libnetfs/fsys-get-children.c b/libnetfs/fsys-get-children.c
index c4bd0f15..6a038d23 100644
--- a/libnetfs/fsys-get-children.c
+++ b/libnetfs/fsys-get-children.c
@@ -54,15 +54,15 @@ netfs_S_fsys_get_children (struct netfs_control *fsys,
goto errout;
err = iohelp_return_malloced_buffer (n, n_len, names, names_len);
+ n = NULL; /* n was freed by iohelp_return_malloced_buffer. */
if (err)
goto errout;
- n = NULL; /* n was freed by iohelp_return_malloced_buffer. */
err = iohelp_return_malloced_buffer ((char *) c, c_count * sizeof *c,
(char **) controls, controlsCnt);
+ c = NULL; /* c was freed by iohelp_return_malloced_buffer. */
if (err)
goto errout;
- c = NULL; /* c was freed by iohelp_return_malloced_buffer. */
*controlsPoly = MACH_MSG_TYPE_MOVE_SEND;
*controlsCnt = c_count;