summaryrefslogtreecommitdiffstats
path: root/Dump.c
diff options
context:
space:
mode:
authorAnthony Youngman <anthony@youngman.org.uk>2018-06-16 21:48:46 +0200
committerJes Sorensen <jsorensen@fb.com>2018-07-11 19:08:25 +0200
commit29446c962f6099b9f0c22b76891ff6a0baeb673d (patch)
tree0a76c515db7ccf0de275959e2beb8a00046f529e /Dump.c
parentCoverity: Resource leak: fix return without free (diff)
downloadmdadm-29446c962f6099b9f0c22b76891ff6a0baeb673d.tar.xz
mdadm-29446c962f6099b9f0c22b76891ff6a0baeb673d.zip
Coverity: Resource leak: close fds and free array before return
Signed-off-by: Anthony Youngman <anthony@youngman.org.uk> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Diffstat (limited to 'Dump.c')
-rw-r--r--Dump.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Dump.c b/Dump.c
index 7bdbf6f7..38e8f238 100644
--- a/Dump.c
+++ b/Dump.c
@@ -301,6 +301,9 @@ int Restore_metadata(char *dev, char *dir, struct context *c,
}
if (c->verbose >= 0)
printf("%s restored from %s.\n", dev, fname);
+ close(fl);
+ close(fd);
+ free(fname);
return 0;
err: