From 1a944fb979cf994bdf3b669248f8508394c1697b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 26 Apr 2006 21:14:22 +0000 Subject: [PATCH] Merge patch "avahi-compat-error-return.patch" from Stanislav Brabec/JP Rosevear, see #30 git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1205 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-compat-libdns_sd/compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/avahi-compat-libdns_sd/compat.c b/avahi-compat-libdns_sd/compat.c index 052c8b2..effa0e7 100644 --- a/avahi-compat-libdns_sd/compat.c +++ b/avahi-compat-libdns_sd/compat.c @@ -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; -- 2.39.5