]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix memory leak in httpClose (Issue #1223)
authorMichael R Sweet <msweet@msweet.org>
Fri, 11 Apr 2025 14:40:38 +0000 (10:40 -0400)
committerMichael R Sweet <msweet@msweet.org>
Fri, 11 Apr 2025 14:40:38 +0000 (10:40 -0400)
CHANGES.md
cups/http.c

index 0b4f512f9b69efb73f003a4b6a75d86181867257..4c2fd0251ac805a0a8984d8e243a5906b984cb78 100644 (file)
@@ -2,6 +2,12 @@ CHANGES - OpenPrinting CUPS
 ===========================
 
 
+Changes in CUPS v2.4.13 (YYYY-MM-DD)
+------------------------------------
+
+- Fixed a memory leak in `httpClose` (Issue #1223)
+
+
 Changes in CUPS v2.4.12 (2025-04-08)
 ------------------------------------
 
@@ -15,7 +21,8 @@ Changes in CUPS v2.4.12 (2025-04-08)
 - Fixed a potential "lost PPD" condition in the scheduler (Issue #1109)
 - Fixed a compressed file error handling bug (Issue #1070)
 - Fixed a bug in the make-and-model whitespace trimming code (Issue #1096)
-- Fixed a removal of IPP Everywhere permanent queue if installation failed (Issue #1102)
+- Fixed a removal of IPP Everywhere permanent queue if installation failed
+  (Issue #1102)
 - Fixed `ServerToken None` in scheduler (Issue #1111)
 - Fixed invalid IPP keyword values created from PPD option names (Issue #1118)
 - Fixed handling of "media" and "PageSize" in the same print request
index 31a8be36142965fd6fe4304a40ec90a98856b062..889760fd291697217a61a3486f8a28e48a1e6301 100644 (file)
@@ -350,6 +350,7 @@ httpClearFields(http_t *http)               /* I - HTTP connection */
 void
 httpClose(http_t *http)                        /* I - HTTP connection */
 {
+  http_field_t field;                  /* Current field */
 #ifdef HAVE_GSSAPI
   OM_uint32    minor_status;           /* Minor status code */
 #endif /* HAVE_GSSAPI */
@@ -392,7 +393,12 @@ httpClose(http_t *http)                    /* I - HTTP connection */
     AuthorizationFree(http->auth_ref, kAuthorizationFlagDefaults);
 #endif /* HAVE_AUTHORIZATION_H */
 
-  httpClearFields(http);
+  for (field = HTTP_FIELD_ACCEPT_LANGUAGE; field < HTTP_FIELD_MAX; field ++)
+  {
+    free(http->default_fields[field]);
+    if (field >= HTTP_FIELD_ACCEPT_ENCODING || http->fields[field] != http->_fields[field])
+      free(http->fields[field]);
+  }
 
   if (http->authstring && http->authstring != http->_authstring)
     free(http->authstring);