git.samba.org
/
mat
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa6cc31
)
smbget: Fix file descriptor leak.
author
Andreas Schneider
<asn@samba.org>
Wed, 20 Feb 2013 09:23:45 +0000
(10:23 +0100)
committer
Alexander Bokovoy
<ab@samba.org>
Fri, 22 Feb 2013 15:36:14 +0000
(16:36 +0100)
Reviewed-by: Alexander Bokovoy <ab@samba.org>
source3/utils/smbget.c
patch
|
blob
|
history
diff --git
a/source3/utils/smbget.c
b/source3/utils/smbget.c
index 207746f5d4b0f2f8ba6dea954ed1b3a130e467d3..5cb6849bf7dcfd9ea700875d0e1e0e27079c7180 100644
(file)
--- 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;
}