]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
cups-browsed.c: uuid was used after its pointer was freed by ippDelete() 311/head
authorZdenek Dohnal <zdohnal@redhat.com>
Mon, 12 Oct 2020 11:01:05 +0000 (13:01 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Mon, 12 Oct 2020 11:01:05 +0000 (13:01 +0200)
utils/cups-browsed.c

index 8c2040b68f004eb95418b2da984178eedbe1870a..b0e7a8038875927612a466d99820926f6f6c0c41 100644 (file)
@@ -3614,7 +3614,7 @@ new_local_printer (const char *device_uri,
 {
   local_printer_t *printer = g_malloc (sizeof (local_printer_t));
   printer->device_uri = strdup (device_uri);
-  printer->uuid = (uuid ? strdup (uuid) : NULL);
+  printer->uuid = uuid;
   printer->cups_browsed_controlled = cups_browsed_controlled;
   return printer;
 }
@@ -3796,7 +3796,7 @@ get_printer_uuid(http_t *http_printer,
 
 
   if (attr)
-    uuid = ippGetString(attr, 0, NULL) + 9;
+    uuid = strdup(ippGetString(attr, 0, NULL) + 9);
   else {
     debug_printf ("Printer with URI %s: Cannot read \"printer-uuid\" IPP attribute!\n",
                  raw_uri);