nsswitch: fix memory leak in winbind_open_pipe_sock() when the privileged pipe is...
authorStefan Metzmacher <metze@samba.org>
Tue, 24 Apr 2018 08:59:05 +0000 (10:59 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 24 Apr 2018 12:32:10 +0000 (14:32 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13400

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
nsswitch/wb_common.c

index d6746b4f535885623442a70ed8120aba37ea895c..da81734ae3c9efbf36d2779c0ca4ef3cd011c049 100644 (file)
@@ -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;