Commit 203a5ed2 authored by Eric Wong's avatar Eric Wong

zeroconf: avoid passing NULLs to Avahi *_free() routines

This should fix Debian bug #428551 (mpd crashes when restarting the dbus daemon) git-svn-id: https://svn.musicpd.org/mpd/trunk@6844 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent bbe8b0ef
......@@ -309,10 +309,12 @@ static void avahiClientCallback(AvahiClient *c, AvahiClientState state, void *us
int reason = avahi_client_errno(c);
if( reason == AVAHI_ERR_DISCONNECTED ) {
LOG( "Avahi: Client Disconnected, will reconnect shortly\n");
avahi_entry_group_free( avahiGroup );
if (avahiGroup) {
avahi_entry_group_free(avahiGroup);
avahiGroup = NULL;
avahi_client_free( avahiClient );
avahiClient = NULL;
}
if (avahiClient)
avahi_client_free(avahiClient);
avahiClient = avahi_client_new( &avahiPoll, AVAHI_CLIENT_NO_FAIL,
avahiClientCallback, NULL, &reason );
if( !avahiClient ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment