summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-02-20 10:09:20 +0100
committerAlexander Bokovoy <ab@samba.org>2013-02-22 16:36:14 +0100
commit82e9ff81cf6a9945cad799ae35279e16837b8033 (patch)
tree9523cfe3d5a085a4b60fd14c83d4b99b082eaa23 /source4/client
parentf4d1e8c1e2920560c9db49cd3511f0edbd577c8b (diff)
downloadsamba-82e9ff81cf6a9945cad799ae35279e16837b8033.tar.gz
samba-82e9ff81cf6a9945cad799ae35279e16837b8033.tar.bz2
samba-82e9ff81cf6a9945cad799ae35279e16837b8033.zip
s4-cifsdd: Don't leak memory.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/cifsdd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index dd6f1377e8..7d412a5d80 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -448,6 +448,7 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
lpcfg_socket_options(lp_ctx),
&session_options,
lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
+ SAFE_FREE(iobuf);
return(FILESYS_EXIT_CODE);
}
@@ -456,6 +457,7 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
lpcfg_socket_options(lp_ctx),
&session_options,
lpcfg_gensec_settings(lp_ctx, lp_ctx)))) {
+ SAFE_FREE(iobuf);
return(FILESYS_EXIT_CODE);
}
@@ -487,6 +489,7 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
while (data_size > 0) {
if (!dd_flush_block(ofile, iobuf,
&data_size, obs)) {
+ SAFE_FREE(iobuf);
return(IOERROR_EXIT_CODE);
}
}
@@ -497,6 +500,7 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
* out one of obs bytes.
*/
if (!dd_fill_block(ifile, iobuf, &data_size, obs, ibs)) {
+ SAFE_FREE(iobuf);
return(IOERROR_EXIT_CODE);
}
@@ -520,11 +524,13 @@ static int copy_files(struct tevent_context *ev, struct loadparm_context *lp_ctx
*/
if (data_size &&
!dd_flush_block(ofile, iobuf, &data_size, obs)) {
+ SAFE_FREE(iobuf);
return(IOERROR_EXIT_CODE);
}
}
done:
+ SAFE_FREE(iobuf);
print_transfer_stats();
return(0);
}