aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/zeroconf.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/zeroconf.c b/src/zeroconf.c
index eeec794cd..0b0163218 100644
--- a/src/zeroconf.c
+++ b/src/zeroconf.c
@@ -297,10 +297,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 ) {