summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-02-20 10:23:45 +0100
committerAlexander Bokovoy <ab@samba.org>2013-02-22 16:36:14 +0100
commit3a3baa442ed77dbc0688d25571bc0edb5c367bcb (patch)
treec5be84af082d61dc248725490e99f0d628794482 /source3
parentaa6cc31ef9b1789b3e81222204f30ba01d69803a (diff)
downloadsamba-3a3baa442ed77dbc0688d25571bc0edb5c367bcb.tar.gz
samba-3a3baa442ed77dbc0688d25571bc0edb5c367bcb.tar.bz2
samba-3a3baa442ed77dbc0688d25571bc0edb5c367bcb.zip
smbget: Fix file descriptor leak.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/utils/smbget.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index 207746f5d4..5cb6849bf7 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -449,6 +449,9 @@ static int smb_download_file(const char *base, const char *name, int recursive,
readbuf = (char *)SMB_MALLOC(blocksize);
if (!readbuf) {
+ if (localhandle != STDOUT_FILENO) {
+ close(localhandle);
+ }
return 1;
}