From 65889fbdee15c7a664670540f59e8f3c5c20c640 Mon Sep 17 00:00:00 2001 From: Georg Chini Date: Thu, 26 May 2022 12:57:45 +0200 Subject: [PATCH] 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: --- src/modules/module-zeroconf-publish.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) {