From 3a3baa442ed77dbc0688d25571bc0edb5c367bcb Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Feb 2013 10:23:45 +0100 Subject: [PATCH] smbget: Fix file descriptor leak. Reviewed-by: Alexander Bokovoy --- source3/utils/smbget.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.34.1