summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Chini <georg@chini.tk>2022-05-26 12:57:45 +0200
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>2022-05-26 16:41:21 +0000
commit65889fbdee15c7a664670540f59e8f3c5c20c640 (patch)
tree603b7a23f981697e5b7becc65413aaea2d7e2f5d
parent5bba8ee621340bde1808ad42e4b61f45821ac886 (diff)
downloadpulseaudio-65889fbdee15c7a664670540f59e8f3c5c20c640.tar.gz
zeroconf-publish: Fix crash when avahi_client_new() fails
When the module is loaded and avahi_client_new() fails because the client cannot connect, a shutdown of the module is scheduled. In parallel, the client_callback is called with AVAHI_ERR_DISCONNECTED and another connection attempt is made which also fails and triggers a second unload of the module. This crashes PA, because there is already an unload in progress. This patch fixes the problem by checking if an unload is already scheduled. Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/710>
-rw-r--r--src/modules/module-zeroconf-publish.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/module-zeroconf-publish.c b/src/modules/module-zeroconf-publish.c
index 7f6c67175..b39afafe4 100644
--- a/src/modules/module-zeroconf-publish.c
+++ b/src/modules/module-zeroconf-publish.c
@@ -645,7 +645,7 @@ static int avahi_process_msg(pa_msgobject *o, int code, void *data, int64_t offs
pa_assert(u);
- if (u->shutting_down)
+ if (u->shutting_down || u->module->unload_requested)
return 0;
switch (code) {