From db1c94f3a1720b26b46d91744d43bb3edb2765dd Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 1 Aug 2019 13:02:23 -0400 Subject: [PATCH] Fix memory leak in ppdOpen. --- CHANGES.md | 1 + cups/ppd.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 9a434e750..920493c88 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,7 @@ Changes in CUPS v2.3.0 shared (rdar://52561199) - Fixed an issue with `EXPECT !name WITH-VALUE ...` tests. - Fixed a command ordering issue in the Zebra ZPL driver. +- Fixed a memory leak in `ppdOpen`. Changes in CUPS v2.3rc1 diff --git a/cups/ppd.c b/cups/ppd.c index 862201127..ada0c14f7 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -705,6 +705,8 @@ _ppdOpen( strncmp(ll, keyword, ll_len))) { DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword)); + free(string); + string = NULL; continue; } else if (localization == _PPD_LOCALIZATION_ICC_PROFILES) @@ -724,6 +726,8 @@ _ppdOpen( if (i >= (int)(sizeof(color_keywords) / sizeof(color_keywords[0]))) { DEBUG_printf(("2_ppdOpen: Ignoring localization: \"%s\"\n", keyword)); + free(string); + string = NULL; continue; } } -- 2.39.2