summaryrefslogtreecommitdiff
path: root/debian/patches/0032-Coverity-Resource-leak-close-fd-before-return.patch
blob: 498697fc17db572de1029e7565cf8f5a16c74d43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From d94eb07f82a7e9c086da23b31c8021107b60f884 Mon Sep 17 00:00:00 2001
From: Anthony Youngman <anthony@youngman.org.uk>
Date: Fri, 15 Jun 2018 22:36:42 +0100
Subject: [PATCH 32/40] Coverity: Resource leak: close fd before return

Anthony Youngman <anthony@youngman.org.uk>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
---
 Grow.c | 1 +
 1 file changed, 1 insertion(+)

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;
-- 
2.17.1