From: Anthony Youngman Date: Sat, 16 Jun 2018 19:48:46 +0000 (+0100) Subject: Coverity: Resource leak: close fds and free array before return X-Git-Tag: mdadm-4.1-rc2~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=29446c962f6099b9f0c22b76891ff6a0baeb673d;p=thirdparty%2Fmdadm.git Coverity: Resource leak: close fds and free array before return Signed-off-by: Anthony Youngman Signed-off-by: Jes Sorensen --- 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: