summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
Diffstat (limited to 'source3/utils')
-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;
}