summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-21 14:18:08 +0100
committerSam James <sam@gentoo.org>2022-10-02 04:31:25 +0100
commita529111f77ff46f4836fe7312e70953bc16587cf (patch)
tree9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /base/gxchar.c
parentImport Ghostscript 9.56.1 (diff)
downloadghostscript-gpl-patches-2233e6caad8b2bc1199d7a9c17fd6996bdbf07e9.tar.gz
ghostscript-gpl-patches-2233e6caad8b2bc1199d7a9c17fd6996bdbf07e9.tar.bz2
ghostscript-gpl-patches-2233e6caad8b2bc1199d7a9c17fd6996bdbf07e9.zip
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'base/gxchar.c')
-rw-r--r--base/gxchar.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/base/gxchar.c b/base/gxchar.c
index 1c534ccb..e3ffa83e 100644
--- a/base/gxchar.c
+++ b/base/gxchar.c
@@ -168,12 +168,19 @@ gx_default_text_begin(gx_device * dev, gs_gstate * pgs1,
if (dev_null == 0)
return_error(gs_error_VMerror);
+
+ /* Set up a null device that forwards xfont requests properly. */
+ /* We have to set the device up here, so the contents are
+ initialised, and safe to free in the event of an error.
+ */
+ gs_make_null_device(dev_null, gs_currentdevice_inline(pgs), mem);
+
/* Do an extra gsave and suppress output */
- if ((code = gs_gsave(pgs)) < 0)
+ if ((code = gs_gsave(pgs)) < 0) {
+ gs_free_object(mem, dev_null, "gx_default_text_begin");
return code;
+ }
penum->level = pgs->level; /* for level check in show_update */
- /* Set up a null device that forwards xfont requests properly. */
- gs_make_null_device(dev_null, gs_currentdevice_inline(pgs), mem);
pgs->ctm_default_set = false;
penum->dev_null = dev_null;
/* Retain this device, since it is referenced from the enumerator. */