From: Wu Guanghao Date: Tue, 14 Oct 2025 03:49:11 +0000 (+0800) Subject: mdadm: Fix memory leak issue in load_ddf_local() X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca10248139610ffb53fe90224333513dcc3ca155;p=thirdparty%2Fmdadm.git mdadm: Fix memory leak issue in load_ddf_local() dl->devname might be allocated space through xstrdup(). Before an abnormal exit, it needs to be checked and released. Signed-off-by: Wu Guanghao --- diff --git a/super-ddf.c b/super-ddf.c index 7b38f912..657c53ab 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1208,6 +1208,8 @@ static int load_ddf_local(int fd, struct ddf_super *super, dl->devname = devname ? xstrdup(devname) : NULL; if (fstat(fd, &stb) != 0) { + if (dl->devname) + free(dl->devname); free(dl); return 1; }