rlescak / rpms / cups

Forked from rpms/cups 2 years ago
Clone
82c5574
diff --git a/cups/http-support.c b/cups/http-support.c
99324c4
index 6317514..ea8640c 100644
82c5574
--- a/cups/http-support.c
82c5574
+++ b/cups/http-support.c
82c5574
@@ -1,8 +1,9 @@
82c5574
 /*
82c5574
  * HTTP support routines for CUPS.
82c5574
  *
82c5574
- * Copyright 2007-2019 by Apple Inc.
82c5574
- * Copyright 1997-2007 by Easy Software Products, all rights reserved.
82c5574
+ * Copyright © 2020 by Michael R Sweet
82c5574
+ * Copyright © 2007-2019 by Apple Inc.
82c5574
+ * Copyright © 1997-2007 by Easy Software Products, all rights reserved.
82c5574
  *
82c5574
  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
82c5574
  * information.
99324c4
@@ -26,6 +27,8 @@
99324c4
 #elif defined(HAVE_AVAHI)
99324c4
 #  include <avahi-client/client.h>
99324c4
 #  include <avahi-client/lookup.h>
99324c4
+// for avahi_free()
99324c4
+#  include <avahi-common/malloc.h>
99324c4
 #  include <avahi-common/simple-watch.h>
99324c4
 #endif /* HAVE_DNSSD */
99324c4
 
99324c4
@@ -2536,6 +2539,8 @@ http_resolve_cb(
82c5574
     memcpy(uuid, value, valueLen);
82c5574
     uuid[valueLen] = '\0';
82c5574
 
82c5574
+    avahi_free(value);
82c5574
+
82c5574
     if (_cups_strcasecmp(uuid, uribuf->uuid))
82c5574
     {
82c5574
       if (uribuf->options & _HTTP_RESOLVE_STDERR)
99324c4
@@ -2620,6 +2625,8 @@ http_resolve_cb(
82c5574
       memcpy(resource + 1, value, valueLen);
82c5574
       resource[valueLen + 1] = '\0';
82c5574
     }
82c5574
+
82c5574
+    avahi_free(value);
82c5574
   }
82c5574
   else
82c5574
   {