summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
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);
}