summaryrefslogtreecommitdiff
path: root/base/gxcpath.c
diff options
context:
space:
mode:
authorShailesh Mistry <shailesh.mistry@hotmail.co.uk>2020-05-08 21:50:30 +0100
committerShailesh Mistry <shailesh.mistry@hotmail.co.uk>2020-05-09 10:49:45 +0100
commit9e553991e4c99814eb342d83b4fb42b5af457390 (patch)
tree0f5c5895e39e0a82aef21b7b5c99f08d14e4a7b0 /base/gxcpath.c
parenta0a3ac239e990a76e937710dce75f3ace1e25be7 (diff)
downloadghostpdl-9e553991e4c99814eb342d83b4fb42b5af457390.tar.gz
Bug 697545 : Prevent numerous memory leaks.
Prevent memory leaks by propagating error codes and freeing loose objects. Also resolve some compiler warnings. Error created using :- MEMENTO_FAILAT=19484 ./membin/gpcl6 -sDEVICE=pbmraw -o /dev/null ./tests_private/pcl/pcl5efts/fts.0051
Diffstat (limited to 'base/gxcpath.c')
-rw-r--r--base/gxcpath.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/gxcpath.c b/base/gxcpath.c
index d9518b8be..082c3890b 100644
--- a/base/gxcpath.c
+++ b/base/gxcpath.c
@@ -403,8 +403,10 @@ gx_cpath_path_list_new(gs_memory_t *mem, gx_clip_path *pcpath, int rule,
rc_init_free(pcplist, mem, 1, rc_free_cpath_path_list);
if (pcpath!=NULL && !pcpath->path_valid) {
code = gx_path_init_contained_shared(&pcplist->path, NULL, mem, cname);
- if (code < 0)
+ if (code < 0) {
+ gs_free_object(mem, pcplist, "gx_cpath_path_list_new");
return code;
+ }
code = gx_cpath_to_path(pcpath, &pcplist->path);
} else {
gx_path_init_local(&pcplist->path, mem);