From: Michael R Sweet Date: Tue, 24 Nov 2020 03:15:26 +0000 (-0500) Subject: Fix memory leak (Issue #49) X-Git-Tag: v2.3.3op1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e38d6dc448dcb19247280b4adf63b89d673b8666;p=thirdparty%2Fcups.git Fix memory leak (Issue #49) --- diff --git a/CHANGES-OPENPRINTING.md b/CHANGES-OPENPRINTING.md index e124e0be35..b7e2357c20 100644 --- a/CHANGES-OPENPRINTING.md +++ b/CHANGES-OPENPRINTING.md @@ -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) diff --git a/cups/http-support.c b/cups/http-support.c index 521b7e06bb..b0506c9764 100644 --- a/cups/http-support.c +++ b/cups/http-support.c @@ -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 {