]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix memory leak (Issue #49)
authorMichael R Sweet <msweet@msweet.org>
Tue, 24 Nov 2020 03:15:26 +0000 (22:15 -0500)
committerMichael R Sweet <msweet@msweet.org>
Tue, 24 Nov 2020 03:15:26 +0000 (22:15 -0500)
CHANGES-OPENPRINTING.md
cups/http-support.c

index e124e0be35a5f6563e61348639a016ebd84af51b..b7e2357c2088ed0c37086e3c71db79f86cbf277a 100644 (file)
@@ -65,5 +65,6 @@ Changes in CUPS v2.3.3op1
 - Fixed IPP backend crash bug with "printer-alert" values (Issue #43)
 - Removed old Solaris inetconv(1m) reference in cups-lpd man page (Issue #46)
 - Fixed default options that incorrectly use the "custom" prefix (Issue #48)
+- Fixed a memory leak when resolving DNS-SD URIs (Issue #49)
 - Fixed crash in rastertopwg (Apple issue #5773)
 - Fixed cupsManualCopies values in IPP Everywhere PPDs (Apple issue #5807)
index 521b7e06bbf95b1aa0cd1691a00eee6e1d4de2e8..b0506c976423e6a89135da0117d6ef42d8b63383 100644 (file)
@@ -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.
@@ -2545,6 +2546,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)
@@ -2629,6 +2632,8 @@ http_resolve_cb(
       memcpy(resource + 1, value, valueLen);
       resource[valueLen + 1] = '\0';
     }
+
+    avahi_free(value);
   }
   else
   {