]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
ppd-cache.c: Free memory leaks when loading caches 1629/head
authorZdenek Dohnal <zdohnal@redhat.com>
Tue, 23 Jun 2026 14:40:48 +0000 (16:40 +0200)
committerZdenek Dohnal <zdohnal@redhat.com>
Tue, 23 Jun 2026 14:40:48 +0000 (16:40 +0200)
When we create temp queue for service shared by ippeveprinter, there are
several leaks in cupsd.

cups/ppd-cache.c

index 538e787cb0ac16a2f76d65a8513c9d8532a93710..acb7fc351cbdee6add0b0cb5870c7e4b9b6381e6 100644 (file)
@@ -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);
 }