From: Lukasz Florczak Date: Fri, 25 Mar 2022 11:48:59 +0000 (+0100) Subject: mdadm: Fix double free X-Git-Tag: mdadm-4.3~175 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ce5a15f0bf007e850e15259bba4f53736605fb2;p=thirdparty%2Fmdadm.git mdadm: Fix double free If there was a size mismatch after creation it would get fixed on grow in imsm_fix_size_mismatch(), but due to double free "double free or corruption (fasttop)" error occurs and grow cannot proceed. Signed-off-by: Lukasz Florczak Signed-off-by: Jes Sorensen --- diff --git a/super-intel.c b/super-intel.c index 5ffa7636..6ff336ee 100644 --- a/super-intel.c +++ b/super-intel.c @@ -11783,9 +11783,8 @@ static int imsm_fix_size_mismatch(struct supertype *st, int subarray_index) st->update_tail = &st->updates; } else { imsm_sync_metadata(st); + free(update); } - - free(update); } ret_val = 0; exit: