From 8f54ce5b7eb0ca982803e270082e33f50897b9a6 Mon Sep 17 00:00:00 2001 From: Nigel Croxon Date: Mon, 4 Nov 2024 11:17:46 -0500 Subject: Coverity fixes resources leaks Handle variable going out of scope leaks the handle. Signed-off-by: Nigel Croxon --- Assemble.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Assemble.c') 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; } -- cgit v1.2.3