From: Michael Sweet Date: Mon, 28 Aug 2017 14:04:29 +0000 (-0400) Subject: Fix an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086) X-Git-Tag: v2.2.5~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b337f966e85ec2ae65769ee6bab12f78edcfafa5;p=thirdparty%2Fcups.git Fix an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086) Add NULL pointer check to avoid Avahi assertion in production code. --- diff --git a/CHANGES.md b/CHANGES.md index 5ac9ec1072..2dbd33ff18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -26,6 +26,7 @@ CHANGES IN CUPS V2.2.5 values (Issue #5074) - The scheduler now creates a PID file when not running on demand with a modern service launcher (Issue #5080) +- Fixed an Avahi-related crash bug in the scheduler (Issue #5085, Issue #5086) - The IPP Everywhere PPD generator now sorts the supported resolutions before choosing them for draft, normal, and best quality modes (Issue #5091) - Fixed an issue with Chinese localizations on macOS (rdar://32419311) diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c index 6f6aa8bb44..2308e05384 100644 --- a/scheduler/dirsvc.c +++ b/scheduler/dirsvc.c @@ -699,13 +699,16 @@ dnssdDeregisterInstance( DNSServiceRefDeallocate(*srv); # else /* HAVE_AVAHI */ - if (!from_callback) - avahi_threaded_poll_lock(DNSSDMaster); + if (*srv) + { + if (!from_callback) + avahi_threaded_poll_lock(DNSSDMaster); - avahi_entry_group_free(*srv); + avahi_entry_group_free(*srv); - if (!from_callback) - avahi_threaded_poll_unlock(DNSSDMaster); + if (!from_callback) + avahi_threaded_poll_unlock(DNSSDMaster); + } # endif /* HAVE_DNSSD */ *srv = NULL;