Skip to content

zeroconf-publish: Fix crash when avahi_client_new() fails

Georg Chini requested to merge gchini/pulseaudio:zeroconf_crash_2 into master

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 which 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. Additionally the connection attempt within the client_callback is removed because it seems potentially unsafe. Bug reported by consolers on IRC.

Merge request reports