From: Andreas Schneider Date: Fri, 9 Feb 2018 14:27:42 +0000 (+0100) Subject: winbindd: Free memory before we exit the connect child X-Git-Tag: tevent-0.9.36~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5cd134ed7634328c9d0b64a45a59c04530c7249;p=thirdparty%2Fsamba.git winbindd: Free memory before we exit the connect child This will make valgrind happy. Signed-off-by: Andreas Schneider Reviewed-by: Volker Lendecke --- diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 54416e02dcd..4229647dc4d 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -199,6 +199,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain) pid_t parent_pid = getpid(); char *lfile = NULL; NTSTATUS status; + bool ok; if (domain->dc_probe_pid != (pid_t)-1) { /* @@ -269,7 +270,9 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain) _exit(1); } - if ((!get_dcs(mem_ctx, domain, &dcs, &num_dcs, 0)) || (num_dcs == 0)) { + ok = get_dcs(mem_ctx, domain, &dcs, &num_dcs, 0); + TALLOC_FREE(mem_ctx); + if (!ok || (num_dcs == 0)) { /* Still offline ? Can't find DC's. */ messaging_send_buf(server_messaging_context(), pid_to_procid(parent_pid),