]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Coverity: Resource leak: close fds and free array before return
authorAnthony Youngman <anthony@youngman.org.uk>
Sat, 16 Jun 2018 19:48:46 +0000 (20:48 +0100)
committerJes Sorensen <jsorensen@fb.com>
Wed, 11 Jul 2018 17:08:25 +0000 (13:08 -0400)
Signed-off-by: Anthony Youngman <anthony@youngman.org.uk>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Dump.c

diff --git a/Dump.c b/Dump.c
index 7bdbf6f754de16f3dc576f0504e814f68db3cc2a..38e8f238a156f22b61b0e8dd8f89f62abed1d607 100644 (file)
--- 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: