From 82e9ff81cf6a9945cad799ae35279e16837b8033 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 20 Feb 2013 10:09:20 +0100 Subject: s4-cifsdd: Don't leak memory. Reviewed-by: Alexander Bokovoy --- source4/client/cifsdd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source4/client') 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); } -- cgit