Allow calls to DNSServiceRefDeallocate() with NULL passed
authorLennart Poettering <lennart@poettering.net>
Sun, 23 Oct 2005 15:43:44 +0000 (15:43 +0000)
committerLennart Poettering <lennart@poettering.net>
Sun, 23 Oct 2005 15:43:44 +0000 (15:43 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@842 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-compat-libdns_sd/compat.c

index 15166d4..cc9ca1c 100644 (file)
@@ -452,12 +452,10 @@ finish:
 }
 
 void DNSSD_API DNSServiceRefDeallocate(DNSServiceRef sdref) {
-    assert(sdref);
-    assert(sdref->n_ref >= 1);
-
     AVAHI_WARN_LINKAGE;
 
-    sdref_unref(sdref);
+    if (sdref)
+        sdref_unref(sdref);
 }
 
 static void service_browser_callback(