summaryrefslogtreecommitdiffstats
path: root/Assemble.c
diff options
context:
space:
mode:
authorNigel Croxon <ncroxon@redhat.com>2024-11-04 17:17:46 +0100
committerMariusz Tkaczyk <mtkaczyk@kernel.org>2024-12-16 10:10:45 +0100
commit8f54ce5b7eb0ca982803e270082e33f50897b9a6 (patch)
tree4b9f1a6eb1e26340f0fb648a370df43b17bc9fb1 /Assemble.c
parentRelease mdadm-4.4 (diff)
downloadmdadm-8f54ce5b7eb0ca982803e270082e33f50897b9a6.tar.xz
mdadm-8f54ce5b7eb0ca982803e270082e33f50897b9a6.zip
Coverity fixes resources leaks
Handle variable going out of scope leaks the handle. Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
Diffstat (limited to 'Assemble.c')
-rw-r--r--Assemble.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Assemble.c b/Assemble.c
index 37a530ee..f8099cd3 100644
--- a/Assemble.c
+++ b/Assemble.c
@@ -753,6 +753,7 @@ static int load_devices(struct devs *devices, char *devmap,
tst->ss->free_super(tst);
free(tst);
*stp = st;
+ free(best);
return -1;
}
close(dfd);
@@ -834,7 +835,6 @@ static int load_devices(struct devs *devices, char *devmap,
inargv ? "the list" :
"the\n DEVICE list in mdadm.conf"
);
- free(best);
*stp = st;
goto error;
}
@@ -857,6 +857,7 @@ error:
close(mdfd);
free(devices);
free(devmap);
+ free(best);
return -1;
}