]> git.meshlink.io Git - catta/commitdiff
Merge patch "avahi-compat-error-return.patch" from Stanislav Brabec/JP Rosevear,...
authorLennart Poettering <lennart@poettering.net>
Wed, 26 Apr 2006 21:14:22 +0000 (21:14 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 26 Apr 2006 21:14:22 +0000 (21:14 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1205 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-compat-libdns_sd/compat.c

index 052c8b2b8444858b6f7cea451819c095e63f524e..effa0e7adbdfbd6dd95176c2ac4af9a35049b7ff 100644 (file)
@@ -374,8 +374,8 @@ static void sdref_unref(DNSServiceRef sdref) {
 }
 
 int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdref) {
-    assert(sdref);
-    assert(sdref->n_ref >= 1);
+    if (!sdref || sdref->n_ref <= 0)
+        return -1;
 
     AVAHI_WARN_LINKAGE;