summaryrefslogtreecommitdiff
path: root/pcl
diff options
context:
space:
mode:
authorJulian Smith <julian.smith@artifex.com>2022-01-25 14:44:43 +0000
committerJulian Smith <julian.smith@artifex.com>2022-01-25 17:51:39 +0000
commitae040bda9c8f8bc93b907987d2c87cb4d0942432 (patch)
treeca72d4e75742cb0d573248c6d1827847cd4f3011 /pcl
parentbe001b95d2f3ad4cc297c9bf86b10c1842f6fa25 (diff)
downloadghostpdl-ae040bda9c8f8bc93b907987d2c87cb4d0942432.tar.gz
pcl/pcl/: pcl_impl_deallocate_interp_instance(): fixed 3 Memento leaks.
Added a call to gx_pattern_cache_free(). Fixes 3 Memento leaks (out of 116) in: ./ghostpdl/mem-extract-bin/gpcl6 -dNOPAUSE -dBATCH -sDEVICE=ppmraw -dMaxBitmap=1000 -r300 -o gpcl6.out tests_private/customer_tests/bug692970.pcl
Diffstat (limited to 'pcl')
-rw-r--r--pcl/pcl/pcl.mak3
-rw-r--r--pcl/pcl/pctop.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/pcl/pcl/pcl.mak b/pcl/pcl/pcl.mak
index 181b11c06..f2542c9eb 100644
--- a/pcl/pcl/pcl.mak
+++ b/pcl/pcl/pcl.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -721,6 +721,7 @@ $(PCL_TOP_OBJ): $(PCLSRC)pctop.c \
$(gsstate_h) \
$(gxalloc_h) \
$(gxdevice_h) \
+ $(gxgstate_h) \
$(gxstate_h) \
$(pjparse_h) \
$(pltop_h) \
diff --git a/pcl/pcl/pctop.c b/pcl/pcl/pctop.c
index 9dadf52b9..d9190b12a 100644
--- a/pcl/pcl/pctop.c
+++ b/pcl/pcl/pctop.c
@@ -33,6 +33,7 @@
#include "gsstate.h"
#include "gxalloc.h"
#include "gxdevice.h"
+#include "gxgstate.h"
#include "gxstate.h"
#include "pjparse.h"
#include "pltop.h"
@@ -570,6 +571,9 @@ pcl_impl_deallocate_interp_instance(pl_interp_implementation_t * impl /* ins
* pcl_impl_allocate_interp_instance. */
gs_grestore_only(pcli->pcs.pgs);
+ /* Fixes 3 Memento leaks with tests_private/customer_tests/bug692970.pcl. */
+ gx_pattern_cache_free(pcli->pcs.pgs->pattern_cache);
+
/* free halftone cache in gs state */
gs_gstate_free(pcli->pcs.pgs);
/* remove pcl's gsave grestore stack */