Fix compiler warning for avahi_free()
This commit is contained in:
parent
82c55743e5
commit
99324c4a1b
@ -1,15 +1,5 @@
|
|||||||
From e38d6dc448dcb19247280b4adf63b89d673b8666 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Michael R Sweet <msweet@msweet.org>
|
|
||||||
Date: Mon, 23 Nov 2020 22:15:26 -0500
|
|
||||||
Subject: [PATCH] Fix memory leak (Issue #49)
|
|
||||||
|
|
||||||
---
|
|
||||||
CHANGES-OPENPRINTING.md | 1 +
|
|
||||||
cups/http-support.c | 9 +++++++--
|
|
||||||
2 files changed, 8 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/cups/http-support.c b/cups/http-support.c
|
diff --git a/cups/http-support.c b/cups/http-support.c
|
||||||
index 521b7e06b..b0506c976 100644
|
index 6317514..ea8640c 100644
|
||||||
--- a/cups/http-support.c
|
--- a/cups/http-support.c
|
||||||
+++ b/cups/http-support.c
|
+++ b/cups/http-support.c
|
||||||
@@ -1,8 +1,9 @@
|
@@ -1,8 +1,9 @@
|
||||||
@ -24,7 +14,16 @@ index 521b7e06b..b0506c976 100644
|
|||||||
*
|
*
|
||||||
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
* Licensed under Apache License v2.0. See the file "LICENSE" for more
|
||||||
* information.
|
* information.
|
||||||
@@ -2545,6 +2546,8 @@ http_resolve_cb(
|
@@ -26,6 +27,8 @@
|
||||||
|
#elif defined(HAVE_AVAHI)
|
||||||
|
# include <avahi-client/client.h>
|
||||||
|
# include <avahi-client/lookup.h>
|
||||||
|
+// for avahi_free()
|
||||||
|
+# include <avahi-common/malloc.h>
|
||||||
|
# include <avahi-common/simple-watch.h>
|
||||||
|
#endif /* HAVE_DNSSD */
|
||||||
|
|
||||||
|
@@ -2536,6 +2539,8 @@ http_resolve_cb(
|
||||||
memcpy(uuid, value, valueLen);
|
memcpy(uuid, value, valueLen);
|
||||||
uuid[valueLen] = '\0';
|
uuid[valueLen] = '\0';
|
||||||
|
|
||||||
@ -33,7 +32,7 @@ index 521b7e06b..b0506c976 100644
|
|||||||
if (_cups_strcasecmp(uuid, uribuf->uuid))
|
if (_cups_strcasecmp(uuid, uribuf->uuid))
|
||||||
{
|
{
|
||||||
if (uribuf->options & _HTTP_RESOLVE_STDERR)
|
if (uribuf->options & _HTTP_RESOLVE_STDERR)
|
||||||
@@ -2629,6 +2632,8 @@ http_resolve_cb(
|
@@ -2620,6 +2625,8 @@ http_resolve_cb(
|
||||||
memcpy(resource + 1, value, valueLen);
|
memcpy(resource + 1, value, valueLen);
|
||||||
resource[valueLen + 1] = '\0';
|
resource[valueLen + 1] = '\0';
|
||||||
}
|
}
|
||||||
@ -42,6 +41,3 @@ index 521b7e06b..b0506c976 100644
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
--
|
|
||||||
2.26.2
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user