From: Aurelien Aptel Date: Tue, 31 May 2016 13:46:47 +0000 (+0200) Subject: s3/client/clitar.c: always close fd X-Git-Tag: tdb-1.3.10~1018 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b79ec200dcc36ab0b8c190b5fba68fc2b5906d9;p=thirdparty%2Fsamba.git s3/client/clitar.c: always close fd Signed-off-by: Aurelien Aptel Reviewed-by: Jeremy Allison Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Thu Jun 2 12:47:26 CEST 2016 on sn-devel-144 --- diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 188f65da9f4..5af0924ab8a 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1257,7 +1257,7 @@ static int tar_read_inclusion_file(struct tar *t, const char* filename) { char *line; int err = 0; - int fd; + int fd = -1; TALLOC_CTX *ctx = talloc_new(NULL); if (ctx == NULL) { return 1; @@ -1281,9 +1281,10 @@ static int tar_read_inclusion_file(struct tar *t, const char* filename) } } - close(fd); - out: + if (fd != -1) { + close(fd); + } talloc_free(ctx); return err; }