From 559d19d55273cb3936a08d9ed2ad7f37e1e525d1 Mon Sep 17 00:00:00 2001 From: Zdenek Dohnal Date: Tue, 23 Jun 2026 16:40:48 +0200 Subject: [PATCH] ppd-cache.c: Free memory leaks when loading caches When we create temp queue for service shared by ippeveprinter, there are several leaks in cupsd. --- cups/ppd-cache.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 538e787cb..acb7fc351 100644 --- a/cups/ppd-cache.c +++ b/cups/ppd-cache.c @@ -2163,6 +2163,14 @@ _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */ cupsArrayDelete(pc->support_files); + cupsArrayDelete(pc->templates); + + for (i = _PWG_PRINT_COLOR_MODE_MONOCHROME; + i < _PWG_PRINT_COLOR_MODE_MAX; i ++) + for (int j = _PWG_PRINT_QUALITY_DRAFT; j < _PWG_PRINT_QUALITY_MAX; j ++) + if (pc->num_presets[i][j]) + cupsFreeOptions(pc->num_presets[i][j], pc->presets[i][j]); + free(pc); }