aboutsummaryrefslogtreecommitdiffstats
path: root/main/cups-filters/cups-filters-memory-leaks.patch
blob: 98d1927dbd296a9eeb307f4da3972cd0b5bf231a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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