git.samba.org
/
abartlet
/
samba.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
271d09f
)
Fix coverity #729. Resource leak in error path.
author
Jeremy Allison
<jra@samba.org>
Sat, 20 Jun 2009 00:26:53 +0000
(17:26 -0700)
committer
Jeremy Allison
<jra@samba.org>
Sat, 20 Jun 2009 00:26:53 +0000
(17:26 -0700)
Jeremy.
source3/client/client.c
patch
|
blob
|
history
diff --git
a/source3/client/client.c
b/source3/client/client.c
index 36a70d012fe9e470d23be33b29d42b21a6f67d01..ed45f4e2caacd3823d55ea3ee40e37373805d204 100644
(file)
--- a/
source3/client/client.c
+++ b/
source3/client/client.c
@@
-1666,6
+1666,7
@@
static int do_put(const char *rname, const char *lname, bool reput)
if (f && reput) {
if (x_tseek(f, start, SEEK_SET) == -1) {
d_printf("Error seeking local file\n");
+ x_fclose(f);
return 1;
}
}
@@
-1692,7
+1693,9
@@
static int do_put(const char *rname, const char *lname, bool reput)
if (!NT_STATUS_IS_OK(cli_close(targetcli, fnum))) {
d_printf("%s closing remote file %s\n",cli_errstr(cli),rname);
- x_fclose(f);
+ if (f != x_stdin) {
+ x_fclose(f);
+ }
return 1;
}