summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-06-19 17:26:53 -0700
committerJeremy Allison <jra@samba.org>2009-06-19 17:26:53 -0700
commit661f0ba73b28d6165e0ba958413adf9cb97662d5 (patch)
treef4afd460107cfcd68e714c630bd92eb6ffda611a /source3
parent271d09f5992bdfe1eba6cfb39563cc899eeda178 (diff)
downloadsamba-661f0ba73b28d6165e0ba958413adf9cb97662d5.tar.gz
samba-661f0ba73b28d6165e0ba958413adf9cb97662d5.tar.bz2
samba-661f0ba73b28d6165e0ba958413adf9cb97662d5.zip
Fix coverity #729. Resource leak in error path.
Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 36a70d012f..ed45f4e2ca 100644
--- 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;
}