From b6a238ea84aa8c7e07b906669cd279f901e7d137 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 1 Jan 2023 11:25:04 +0100 Subject: fsys_get_children: Fix double-free on error --- libdiskfs/fsys-get-children.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdiskfs/fsys-get-children.c') diff --git a/libdiskfs/fsys-get-children.c b/libdiskfs/fsys-get-children.c index 7e2a37b1..1c20f1ee 100644 --- a/libdiskfs/fsys-get-children.c +++ b/libdiskfs/fsys-get-children.c @@ -60,9 +60,9 @@ diskfs_S_fsys_get_children (struct diskfs_control *fsys, 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; -- cgit v1.2.3