Blame SOURCES/0001-cups-http-encode-memleaks-fixes-issue-322.patch

33f9d9
From d9924186325c89aefa56e36258f56f246dd2c4ad Mon Sep 17 00:00:00 2001
33f9d9
From: Richard Lescak <rlescak@redhat.com>
33f9d9
Date: Tue, 11 Jan 2022 10:53:34 +0100
33f9d9
Subject: [PATCH] cups/http.c,encode.c: Fix memory leaks
33f9d9
 
33f9d9
---
33f9d9
 CHANGES.md    | 3 ++-
33f9d9
 cups/encode.c | 1 +
33f9d9
 cups/http.c   | 1 +
33f9d9
 3 files changed, 4 insertions(+), 1 deletion(-)
33f9d9
 
33f9d9
diff --git a/cups/encode.c b/cups/encode.c
33f9d9
index 5bcbf6fe5..15b1c6b40 100644
33f9d9
--- a/cups/encode.c
33f9d9
+++ b/cups/encode.c
33f9d9
@@ -655,6 +655,7 @@ _cupsEncodeOption(
33f9d9
 	  ippSetCollection(ipp, &attr, i, collection);
33f9d9
 	  cupsEncodeOptions2(collection, num_cols, cols, IPP_TAG_JOB);
33f9d9
 	  cupsFreeOptions(num_cols, cols);
33f9d9
+	  ippDelete(collection);
33f9d9
 	  break;
33f9d9
 
33f9d9
       default :
33f9d9
diff --git a/cups/http.c b/cups/http.c
33f9d9
index bd41e6f8e..4b6a24bd3 100644
33f9d9
--- a/cups/http.c
33f9d9
+++ b/cups/http.c
33f9d9
@@ -4624,6 +4624,7 @@ http_tls_upgrade(http_t *http)		/* I - HTTP connection */
33f9d9
   * Restore the HTTP request data...
33f9d9
   */
33f9d9
 
33f9d9
+  httpClearFields(http);
33f9d9
   memcpy(http->_fields, myhttp._fields, sizeof(http->_fields));
33f9d9
   memcpy(http->fields, myhttp.fields, sizeof(http->fields));
33f9d9
 
33f9d9
diff --git a/cups/ppd.c b/cups/ppd.c
33f9d9
index 525df3592..54368ac4c 100644
33f9d9
--- a/cups/ppd.c
33f9d9
+++ b/cups/ppd.c
33f9d9
@@ -3430,12 +3430,12 @@ ppd_update_filters(ppd_file_t     *ppd,	/* I - PPD file */
33f9d9
 		srctype[256],
33f9d9
 		dstsuper[16],		/* Destination MIME media type */
33f9d9
 		dsttype[256],
33f9d9
-		program[1024],		/* Command to run */
33f9d9
 		*ptr,			/* Pointer into command to run */
33f9d9
 		buffer[1024],		/* Re-written cupsFilter value */
33f9d9
 		**filter;		/* Current filter */
33f9d9
   int		cost;			/* Cost of filter */
33f9d9
 
33f9d9
+  char		program[1024] = { 0 };	/* Command to run */
33f9d9
 
33f9d9
   DEBUG_printf(("4ppd_update_filters(ppd=%p, cg=%p)", ppd, pg));
33f9d9