]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
ppd-cache: fix memory leak in `_cupsConvertOptions()` 1354/head
authorElizaveta Tereshkina <etereshkina@astralinux.ru>
Tue, 2 Sep 2025 13:25:34 +0000 (16:25 +0300)
committerElizaveta Tereshkina <etereshkina@astralinux.ru>
Tue, 2 Sep 2025 13:25:34 +0000 (16:25 +0300)
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 <etereshkina@astralinux.ru>
cups/ppd-cache.c

index 20e88522d39a511529977bdb0decc4c6932d3524..4f88892e64a0b9d372937c453e1c29bfa019cd22 100644 (file)
@@ -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)