From: Zdenek Dohnal Date: Tue, 23 Jun 2026 14:40:48 +0000 (+0200) Subject: ppd-cache.c: Free memory leaks when loading caches X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=559d19d55273cb3936a08d9ed2ad7f37e1e525d1;p=thirdparty%2Fcups.git 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. --- diff --git a/cups/ppd-cache.c b/cups/ppd-cache.c index 538e787cb0..acb7fc351c 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); }