From: Richard Lescak Date: Tue, 11 Jan 2022 09:53:34 +0000 (+0100) Subject: cups/http.c,encode.c: Fix memory leaks X-Git-Tag: v2.4.1~10^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9924186325c89aefa56e36258f56f246dd2c4ad;p=thirdparty%2Fcups.git cups/http.c,encode.c: Fix memory leaks --- diff --git a/CHANGES.md b/CHANGES.md index 7093040452..658c5602ce 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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) diff --git a/cups/encode.c b/cups/encode.c index 5bcbf6fe5a..15b1c6b405 100644 --- a/cups/encode.c +++ b/cups/encode.c @@ -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 : diff --git a/cups/http.c b/cups/http.c index bd41e6f8ed..4b6a24bd36 100644 --- a/cups/http.c +++ b/cups/http.c @@ -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));