[cups-filters/f19] Fix memory leaks in cups-browsed (bug #1027317)

Jaromir Koncicky jkoncick at fedoraproject.org
Thu Nov 14 09:59:45 UTC 2013


commit af64aeb120926b9aea1e856840002f62a6ae2ee6
Author: Jaromír Končický <jkoncick at redhat.com>
Date:   Thu Nov 14 10:57:30 2013 +0100

    Fix memory leaks in cups-browsed (bug #1027317)

 cups-filters-memory-leaks.patch |   36 ++++++++++++++++++++++++++++++++++++
 cups-filters.spec               |    9 ++++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/cups-filters-memory-leaks.patch b/cups-filters-memory-leaks.patch
new file mode 100644
index 0000000..98d1927
--- /dev/null
+++ b/cups-filters-memory-leaks.patch
@@ -0,0 +1,36 @@
+diff --git a/utils/cups-browsed.c b/utils/cups-browsed.c
+index c312804..155b581 100644
+--- a/utils/cups-browsed.c
++++ b/utils/cups-browsed.c
+@@ -993,6 +993,10 @@ void generate_local_queue(const char *host,
+ 	 would get, so ignore this remote printer */
+       debug_printf("cups-browsed: Printer with URI %s already exists, printer ignored.\n",
+ 		   uri);
++      free (uri);
++      free (remote_host);
++      free (backup_queue_name);
++      cupsFreeDests(num_dests, dests);
+       return;
+     }
+     /* Is there a local queue with the name of the remote queue? */
+@@ -1027,6 +1031,7 @@ void generate_local_queue(const char *host,
+ 	   ignore this remote printer */
+ 	debug_printf("cups-browsed: %s also taken, printer ignored.\n",
+ 		     local_queue_name);
++	free (uri);
+ 	free (backup_queue_name);
+ 	free (remote_host);
+ 	cupsFreeDests(num_dests, dests);
+@@ -2426,9 +2431,9 @@ int main(int argc, char*argv[]) {
+ 	    strcasecmp(val, "false") != 0) {
+ 	  /* Queue found, add to our list */
+ 	  p = create_local_queue (dest->name,
+-				  strdup(cupsGetOption("device-uri",
+-						       dest->num_options,
+-						       dest->options)),
++				  cupsGetOption("device-uri",
++						dest->num_options,
++						dest->options),
+ 				  "", "", "", "", NULL, 1);
+ 	  if (p) {
+ 	    /* Mark as unconfirmed, if no Avahi report of this queue appears
diff --git a/cups-filters.spec b/cups-filters.spec
index ec6bd13..364e73b 100644
--- a/cups-filters.spec
+++ b/cups-filters.spec
@@ -4,7 +4,7 @@
 Summary: OpenPrinting CUPS filters and backends
 Name:    cups-filters
 Version: 1.0.41
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 # For a breakdown of the licensing, see COPYING file
 # GPLv2:   filters: commandto*, imagetoraster, pdftops, rasterto*,
@@ -23,6 +23,7 @@ Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{versio
 
 Patch1: cups-filters-pdf-landscape.patch
 Patch2: cups-filters-dbus.patch
+Patch3: cups-filters-memory-leaks.patch
 
 Requires: cups-filters-libs%{?_isa} = %{version}-%{release}
 
@@ -112,6 +113,9 @@ This is the development package for OpenPrinting CUPS filters and backends.
 # Include dbus so that colord support works (bug #1026928).
 %patch2 -p1 -b .dbus
 
+# Fix memory leaks in cups-browsed (bug #1027317).
+%patch3 -p1 -b .memory-leaks
+
 %build
 # work-around Rpath
 ./autogen.sh
@@ -226,6 +230,9 @@ fi
 %{_libdir}/libfontembed.so
 
 %changelog
+* Thu Nov 14 2013 Jaromír Končický <jkoncick at redhat.com> - 1.0.41-3
+- Fix memory leaks in cups-browsed (bug #1027317).
+
 * Wed Nov  6 2013 Tim Waugh <twaugh at redhat.com> - 1.0.41-2
 - Include dbus so that colord support works (bug #1026928).
 


More information about the scm-commits mailing list