]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Coverity: Resource leak: close fd before return
authorAnthony Youngman <anthony@youngman.org.uk>
Fri, 15 Jun 2018 21:36:42 +0000 (22:36 +0100)
committerJes Sorensen <jsorensen@fb.com>
Wed, 11 Jul 2018 17:11:17 +0000 (13:11 -0400)
Anthony Youngman <anthony@youngman.org.uk>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Grow.c

diff --git a/Grow.c b/Grow.c
index a4be7e7ba62ff399044f3da7df3ca807d3380a61..30c5fa91c06d7c1b38b342cfbaff5df06645f913 100644 (file)
--- a/Grow.c
+++ b/Grow.c
@@ -242,6 +242,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
                if (st->ss->load_super(st, fd2, NULL)) {
                        pr_err("cannot find super block on %s\n", dv);
                        close(fd);
+                       close(fd2);
                        return 1;
                }
                info.array.raid_disks = nd+1;