From 29446c962f6099b9f0c22b76891ff6a0baeb673d Mon Sep 17 00:00:00 2001 From: Anthony Youngman 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 Signed-off-by: Jes Sorensen --- 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