summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2015-01-30 16:15:53 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2015-01-30 16:15:53 +0000
commit3644808db76f28b30ebc46fbc2436f497a60a878 (patch)
treec9376c0f7722362a778728f609536a96fbf0b3c5
parent726429cbd4fd090231eda85713eb36e513c647c8 (diff)
The scheduler could crash during shutdown if Avahi was shutdown first
(STR #4550) git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12458 a1ca3aef-8c08-0410-bb20-df032aa958be
-rw-r--r--CHANGES-2.0.txt2
-rw-r--r--scheduler/dirsvc.c19
2 files changed, 15 insertions, 6 deletions
diff --git a/CHANGES-2.0.txt b/CHANGES-2.0.txt
index c61db95db..3d45d6676 100644
--- a/CHANGES-2.0.txt
+++ b/CHANGES-2.0.txt
@@ -29,6 +29,8 @@ CHANGES IN CUPS V2.0.2
- cupsGetPPD* sent bad requests (STR #4567)
- ippserver used the wrong temporary directory on Windows (STR #4547)
- ippserver did not handle Bonjour registrations properly (STR #4548)
+ - The scheduler could crash during shutdown if Avahi was shutdown
+ first (STR #4550)
CHANGES IN CUPS V2.0.1
diff --git a/scheduler/dirsvc.c b/scheduler/dirsvc.c
index 4e417b0b2..71a002cd1 100644
--- a/scheduler/dirsvc.c
+++ b/scheduler/dirsvc.c
@@ -3,7 +3,7 @@
*
* Directory services routines for the CUPS scheduler.
*
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
@@ -1296,13 +1296,20 @@ dnssdStop(void)
DNSSDMaster = NULL;
# else /* HAVE_AVAHI */
- avahi_threaded_poll_stop(DNSSDMaster);
+ if (DNSSDMaster)
+ avahi_threaded_poll_stop(DNSSDMaster);
- avahi_client_free(DNSSDClient);
- DNSSDClient = NULL;
+ if (DNSSDClient)
+ {
+ avahi_client_free(DNSSDClient);
+ DNSSDClient = NULL;
+ }
- avahi_threaded_poll_free(DNSSDMaster);
- DNSSDMaster = NULL;
+ if (DNSSDMaster)
+ {
+ avahi_threaded_poll_free(DNSSDMaster);
+ DNSSDMaster = NULL;
+ }
# endif /* HAVE_DNSSD */
cupsArrayDelete(DNSSDPrinters);