From: Michael R Sweet Date: Thu, 1 Aug 2019 17:02:35 +0000 (-0400) Subject: Fix memory leak in ppdOpen. X-Git-Tag: v2.2.12~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4909ef014261cf30751a52ee47ba1702c90616e;p=thirdparty%2Fcups.git Fix memory leak in ppdOpen. --- diff --git a/CHANGES.md b/CHANGES.md index 2e677a5bc2..1c1bc05cb0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ Changes in CUPS v2.2.12 - The scheduler would restart continuously when idle and printers were not shared (rdar://52561199) - Fixed a command ordering issue in the Zebra ZPL driver. +- Fixed a memory leak in `ppdOpen`. Changes in CUPS v2.2.11 diff --git a/cups/ppd.c b/cups/ppd.c index 29456d97a5..8088fd04e5 100644 --- a/cups/ppd.c +++ b/cups/ppd.c @@ -716,6 +716,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) @@ -735,6 +737,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; } }