summaryrefslogtreecommitdiff
path: root/devices
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2023-03-29 16:42:31 +0100
committerRobin Watts <Robin.Watts@artifex.com>2023-03-29 16:43:04 +0100
commitbf6dab625243b502b0aee022b651e4dc365e66b5 (patch)
treee462e143de4f98d444debf79b92a120727e8c7ba /devices
parent3df0523f3da7536554c3f932a18c8d2fbd7cd5ec (diff)
downloadghostpdl-bf6dab625243b502b0aee022b651e4dc365e66b5.tar.gz
Fix memory leak in gdevdocx.c device.
Diffstat (limited to 'devices')
-rw-r--r--devices/vector/gdevdocxw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/devices/vector/gdevdocxw.c b/devices/vector/gdevdocxw.c
index 0a5ac3aab..f8ed2b266 100644
--- a/devices/vector/gdevdocxw.c
+++ b/devices/vector/gdevdocxw.c
@@ -733,7 +733,8 @@ docx_update_text_state(docx_list_entry_t *ppts,
ppts->size = size;
ppts->matrix = tmat;
- ppts->FontName = (char *)gs_malloc(pdev->memory->stable_memory, 1,
+ gs_free_object(pdev->memory->non_gc_memory, ppts->FontName, "txtwrite alloc font name");
+ ppts->FontName = (char *)gs_malloc(pdev->memory, 1,
font->font_name.size + 1, "txtwrite alloc font name");
if (!ppts->FontName)
return gs_note_error(gs_error_VMerror);
@@ -1264,7 +1265,10 @@ textw_text_release(gs_text_enum_t *pte, client_name_t cname)
* an error.
*/
if (penum->text_state)
+ {
+ gs_free_object(tdev->memory->non_gc_memory, penum->text_state->FontName, "txtwrite free text state");
gs_free(tdev->memory, penum->text_state, 1, sizeof(penum->text_state), "txtwrite free text state");
+ }
gs_text_release(NULL, pte, cname);
}