From cfeb724d58b95f975b88103775a6f97b0b605244 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 6 Dec 2019 22:27:27 +0100 Subject: [PATCH] pulse: don't add listener when connection failed --- pipewire-pulseaudio/src/context.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipewire-pulseaudio/src/context.c b/pipewire-pulseaudio/src/context.c index c1895e0df..40ba6febc 100644 --- a/pipewire-pulseaudio/src/context.c +++ b/pipewire-pulseaudio/src/context.c @@ -1060,9 +1060,11 @@ int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t fla if (c->core_proxy == NULL) { context_fail(c, PA_ERR_CONNECTIONREFUSED); res = -1; + goto exit; } pw_core_proxy_add_listener(c->core_proxy, &c->core_listener, &core_events, c); +exit: pa_context_unref(c); return res;