From a5cd134ed7634328c9d0b64a45a59c04530c7249 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 9 Feb 2018 15:27:42 +0100 Subject: [PATCH] winbindd: Free memory before we exit the connect child This will make valgrind happy. Signed-off-by: Andreas Schneider Reviewed-by: Volker Lendecke --- source3/winbindd/winbindd_cm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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), -- 2.34.1