summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-05-11 16:10:31 -0700
committerRalph Boehme <slow@samba.org>2017-05-13 16:50:13 +0200
commitdd8008250b259acdb02d3b067f8a4194dd68c14a (patch)
treef0ced60c90e7d88db693553707f61e3f79bf0e4f /source4/client
parent1ad4bae2623ff487509b1b5f15b9253e7c522f5f (diff)
downloadsamba-dd8008250b259acdb02d3b067f8a4194dd68c14a.tar.gz
s4: cifsdd: Allocate the event context off NULL, not talloc_autofree_context().
Ensure it's freed on exit paths. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/cifsdd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index 980948a1d6b..7ab59cd49e2 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -551,6 +551,7 @@ int main(int argc, const char ** argv)
int i;
const char ** dd_args;
struct tevent_context *ev;
+ int rc;
poptContext pctx;
struct poptOption poptions[] = {
@@ -601,7 +602,7 @@ int main(int argc, const char ** argv)
}
}
- ev = s4_event_context_init(talloc_autofree_context());
+ ev = s4_event_context_init(NULL);
gensec_init();
dump_args();
@@ -609,22 +610,27 @@ int main(int argc, const char ** argv)
if (check_arg_numeric("ibs") == 0 || check_arg_numeric("obs") == 0) {
fprintf(stderr, "%s: block sizes must be greater that zero\n",
PROGNAME);
+ talloc_free(ev);
exit(SYNTAX_EXIT_CODE);
}
if (check_arg_pathname("if") == NULL) {
fprintf(stderr, "%s: missing input filename\n", PROGNAME);
+ talloc_free(ev);
exit(SYNTAX_EXIT_CODE);
}
if (check_arg_pathname("of") == NULL) {
fprintf(stderr, "%s: missing output filename\n", PROGNAME);
+ talloc_free(ev);
exit(SYNTAX_EXIT_CODE);
}
CatchSignal(SIGINT, dd_handle_signal);
CatchSignal(SIGUSR1, dd_handle_signal);
- return(copy_files(ev, cmdline_lp_ctx));
+ rc = copy_files(ev, cmdline_lp_ctx);
+ talloc_free(ev);
+ return rc;
}
/* vim: set sw=8 sts=8 ts=8 tw=79 : */