summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Youngman <anthony@youngman.org.uk>2018-06-15 23:36:42 +0200
committerJes Sorensen <jsorensen@fb.com>2018-07-11 19:11:17 +0200
commitd94eb07f82a7e9c086da23b31c8021107b60f884 (patch)
tree18f8a6c6b5ca3bfcc5642f569502cf872573b172
parentCoverity: Resource leak: close fds and free array before return (diff)
downloadmdadm-d94eb07f82a7e9c086da23b31c8021107b60f884.tar.xz
mdadm-d94eb07f82a7e9c086da23b31c8021107b60f884.zip
Coverity: Resource leak: close fd before return
Anthony Youngman <anthony@youngman.org.uk> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r--Grow.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Grow.c b/Grow.c
index a4be7e7b..30c5fa91 100644
--- 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;