From: Stefan Metzmacher Date: Tue, 24 Apr 2018 08:59:05 +0000 (+0200) Subject: nsswitch: fix memory leak in winbind_open_pipe_sock() when the privileged pipe is... X-Git-Tag: ldb-1.4.0~542 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffe970007bf934955f72ec2d73bf8f94a2b796eb;p=thirdparty%2Fsamba.git nsswitch: fix memory leak in winbind_open_pipe_sock() when the privileged pipe is not accessable. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13400 Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke --- diff --git a/nsswitch/wb_common.c b/nsswitch/wb_common.c index d6746b4f535..da81734ae3c 100644 --- a/nsswitch/wb_common.c +++ b/nsswitch/wb_common.c @@ -420,14 +420,14 @@ static int winbind_open_pipe_sock(struct winbindd_context *ctx, ctx->winbindd_fd = fd; ctx->is_privileged = 1; } + + SAFE_FREE(response.extra_data.data); } if ((need_priv != 0) && (ctx->is_privileged == 0)) { return -1; } - SAFE_FREE(response.extra_data.data); - return ctx->winbindd_fd; #else return -1;