summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAurelien Aptel <aaptel@suse.com>2016-05-31 15:46:47 +0200
committerAndreas Schneider <asn@cryptomilk.org>2016-06-02 12:47:26 +0200
commit0b79ec200dcc36ab0b8c190b5fba68fc2b5906d9 (patch)
tree0eb552c9466871c159a91ad549e9be8c1f2e332a /source3
parente70fef92b2da7593f32c92079b257299bd8fb8b9 (diff)
downloadsamba-0b79ec200dcc36ab0b8c190b5fba68fc2b5906d9.tar.gz
s3/client/clitar.c: always close fd
Signed-off-by: Aurelien Aptel <aaptel@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jun 2 12:47:26 CEST 2016 on sn-devel-144
Diffstat (limited to 'source3')
-rw-r--r--source3/client/clitar.c7
1 files changed, 4 insertions, 3 deletions
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;
}