summaryrefslogtreecommitdiff
path: root/debian/patches/0031-Coverity-Resource-leak-close-fds-and-free-array-befo.patch
blob: 1507ce4aef1b317d0f9843bca713ca5a055ed8c8 (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
27
28
29
From 29446c962f6099b9f0c22b76891ff6a0baeb673d Mon Sep 17 00:00:00 2001
From: Anthony Youngman <anthony@youngman.org.uk>
Date: Sat, 16 Jun 2018 20:48:46 +0100
Subject: [PATCH 31/40] 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>
---
 Dump.c | 3 +++
 1 file changed, 3 insertions(+)

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