]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cups/http.c,encode.c: Fix memory leaks
authorRichard Lescak <rlescak@redhat.com>
Tue, 11 Jan 2022 09:53:34 +0000 (10:53 +0100)
committerZdenek Dohnal <zdohnal@redhat.com>
Wed, 12 Jan 2022 07:15:58 +0000 (08:15 +0100)
CHANGES.md
cups/encode.c
cups/http.c

index 7093040452d4b8e12f0ef63884cc7d5cda0d9e87..658c5602cee2882c34c40767df676105e983c29e 100644 (file)
@@ -5,7 +5,8 @@ Changes in CUPS v2.4.1 (TBA)
 ----------------------------
 
 - Configuration script now checks linking for -Wl,-pie flags (Issue #303)
-- Fixed memory leaks - in testi18n (Issue #313), in `cups_enum_dests()` (Issue #317)
+- Fixed memory leaks - in testi18n (Issue #313), in `cups_enum_dests()` (Issue #317),
+  in `_cupsEncodeOption()` and `http_tls_upgrade()` (Issue #322)
 - Fixed missing bracket in de/index.html (Issue #299)
 - Fixed typos in configuration scripts (Issues #304, #316)
 - Removed deprecated directives from cupsctl and cups-files.conf (Issue #300)
index 5bcbf6fe5a749011f759a4b05de18011571fd891..15b1c6b405cc82f174ce5fce2deb8249becc69aa 100644 (file)
@@ -655,6 +655,7 @@ _cupsEncodeOption(
          ippSetCollection(ipp, &attr, i, collection);
          cupsEncodeOptions2(collection, num_cols, cols, IPP_TAG_JOB);
          cupsFreeOptions(num_cols, cols);
+         ippDelete(collection);
          break;
 
       default :
index bd41e6f8ed2b86bbe468903d1e7678771cd03144..4b6a24bd3620aa5fbc7b1e5bb3f69fd6fb48e480 100644 (file)
@@ -4627,6 +4627,7 @@ http_tls_upgrade(http_t *http)            /* I - HTTP connection */
   * Restore the HTTP request data...
   */
 
+  httpClearFields(http);
   memcpy(http->_fields, myhttp._fields, sizeof(http->_fields));
   memcpy(http->fields, myhttp.fields, sizeof(http->fields));