diff --git a/0001-Fix-memory-leak-Issue-49.patch b/0001-Fix-memory-leak-Issue-49.patch new file mode 100644 index 0000000..5afb84e --- /dev/null +++ b/0001-Fix-memory-leak-Issue-49.patch @@ -0,0 +1,43 @@ +diff --git a/cups/http-support.c b/cups/http-support.c +index 6317514..ea8640c 100644 +--- a/cups/http-support.c ++++ b/cups/http-support.c +@@ -1,8 +1,9 @@ + /* + * HTTP support routines for CUPS. + * +- * Copyright 2007-2019 by Apple Inc. +- * Copyright 1997-2007 by Easy Software Products, all rights reserved. ++ * Copyright © 2020 by Michael R Sweet ++ * Copyright © 2007-2019 by Apple Inc. ++ * Copyright © 1997-2007 by Easy Software Products, all rights reserved. + * + * Licensed under Apache License v2.0. See the file "LICENSE" for more + * information. +@@ -26,6 +27,8 @@ + #elif defined(HAVE_AVAHI) + # include + # include ++// for avahi_free() ++# include + # include + #endif /* HAVE_DNSSD */ + +@@ -2536,6 +2539,8 @@ http_resolve_cb( + memcpy(uuid, value, valueLen); + uuid[valueLen] = '\0'; + ++ avahi_free(value); ++ + if (_cups_strcasecmp(uuid, uribuf->uuid)) + { + if (uribuf->options & _HTTP_RESOLVE_STDERR) +@@ -2620,6 +2625,8 @@ http_resolve_cb( + memcpy(resource + 1, value, valueLen); + resource[valueLen + 1] = '\0'; + } ++ ++ avahi_free(value); + } + else + { diff --git a/cups.spec b/cups.spec index db54ea3..3493581 100644 --- a/cups.spec +++ b/cups.spec @@ -15,7 +15,7 @@ Summary: CUPS printing system Name: cups Epoch: 1 Version: 2.3.3 -Release: 19%{?dist} +Release: 20%{?dist} License: ASL 2.0 Url: http://www.cups.org/ Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz @@ -123,6 +123,7 @@ Patch29: cups-manual-copies.patch # freed as a different attribute type than it was allocated # backported from upstream https://github.com/OpenPrinting/cups/pull/43 Patch30: 0001-backend-scheduler-ipp.c-Fix-printer-alert-invalid-fr.patch +Patch31: 0001-Fix-memory-leak-Issue-49.patch ##### Patches removed because IMHO they aren't no longer needed ##### but still I'll leave them in git in case their removal @@ -342,6 +343,7 @@ to CUPS daemon. This solution will substitute printer drivers and raw queues in %patch28 -p1 -b .ipptool-mdns-uri %patch29 -p1 -b .manual-copies %patch30 -p1 -b .printer-alert +%patch31 -p1 -b .avahi-leak # if cupsd is set to log into /var/log/cups, then 'MaxLogSize 0' needs to be @@ -768,6 +770,9 @@ rm -f %{cups_serverbin}/backend/smb %{_mandir}/man7/ippevepcl.7.gz %changelog +* Tue Nov 24 2020 Zdenek Dohnal - 1:2.3.3-20 +- fix memory leak during device discovery + * Thu Nov 12 2020 Zdenek Dohnal - 1:2.3.3-19 - 1897023 - Cups service restart sequence during upgrade incorrect