Guus Sliepen <[EMAIL PROTECTED]> wrote:
> Package: mpd
> Version: 0.13.0-1
> Severity: normal
> 
> When doing "invoke-rc.d dbus restart", mpd crashes. This is caused by
> passing a NULL pointer to avahi_entry_group_free() on line 300 of
> src/zeroconf.c.

Hi Guus,

I've committed the following to SVN which should fix it:

------------------------------------------------------------------------
r6844 | normalperson | 2007-09-01 19:18:09 -0700 (Sat, 01 Sep 2007) | 5 lines

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

This should fix Debian bug #428551
  (mpd crashes when restarting the dbus daemon)


diff --git a/src/zeroconf.c b/src/zeroconf.c
index 539f482..1836c64 100644
--- a/src/zeroconf.c
+++ b/src/zeroconf.c
@@ -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 );
-                                       avahiGroup = NULL;
-                                       avahi_client_free( avahiClient );
-                                       avahiClient = NULL;
+                                       if (avahiGroup) {
+                                               
avahi_entry_group_free(avahiGroup);
+                                               avahiGroup = NULL;
+                                       }
+                                       if (avahiClient)
+                                               avahi_client_free(avahiClient);
                                        avahiClient = avahi_client_new( 
&avahiPoll, AVAHI_CLIENT_NO_FAIL,
                                                avahiClientCallback, NULL, 
&reason );
                                        if( !avahiClient ) {
------------------------------------------------------------------------
-- 
Eric Wong


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to