From: Elizaveta Tereshkina Date: Tue, 2 Sep 2025 13:25:34 +0000 (+0300) Subject: ppd-cache: fix memory leak in `_cupsConvertOptions()` X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1354%2Fhead;p=thirdparty%2Fcups.git ppd-cache: fix memory leak in `_cupsConvertOptions()` Add `ippDelete()` after `ippAddCollection()` to avoid memory leak. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: f099325eb (Move _cupsConvertOptions to ppd-cache since it depends on PPDs.) Signed-off-by: Elizaveta Tereshkina --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 20e88522d3..4f88892e64 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -228,6 +228,7 @@ _cupsConvertOptions( "y-dimension", size->length); ippAddCollection(media_col, IPP_TAG_ZERO, "media-size", media_size); + ippDelete(media_size); } for (i = 0; i < media_col_sup->num_values; i ++) @@ -247,6 +248,7 @@ _cupsConvertOptions( } ippAddCollection(request, IPP_TAG_JOB, "media-col", media_col); + ippDelete(media_col); } if ((keyword = cupsGetOption("output-bin", num_options, options)) == NULL)