diff options
author | Andreas Schneider <asn@samba.org> | 2013-02-20 10:23:45 +0100 |
---|---|---|
committer | Alexander Bokovoy <ab@samba.org> | 2013-02-22 16:36:14 +0100 |
commit | 3a3baa442ed77dbc0688d25571bc0edb5c367bcb (patch) | |
tree | c5be84af082d61dc248725490e99f0d628794482 | |
parent | aa6cc31ef9b1789b3e81222204f30ba01d69803a (diff) | |
download | samba-3a3baa442ed77dbc0688d25571bc0edb5c367bcb.tar.gz samba-3a3baa442ed77dbc0688d25571bc0edb5c367bcb.tar.bz2 samba-3a3baa442ed77dbc0688d25571bc0edb5c367bcb.zip |
smbget: Fix file descriptor leak.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
-rw-r--r-- | source3/utils/smbget.c | 3 |
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; } |