From 43d616bd0c9e200a91c32d3c5e766a9fdd8522ff Mon Sep 17 00:00:00 2001 From: Elizaveta Tereshkina Date: Tue, 2 Sep 2025 16:25:34 +0300 Subject: [PATCH] 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 --- cups/ppd-cache.c | 2 ++ 1 file changed, 2 insertions(+) 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) -- 2.47.3