summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--base/gxacpath.c4
-rw-r--r--base/gxcpath.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/base/gxacpath.c b/base/gxacpath.c
index 6487c3005..ebed0eb69 100644
--- a/base/gxacpath.c
+++ b/base/gxacpath.c
@@ -228,8 +228,8 @@ gx_cpath_accum_end(gx_device_cpath_accum * padev, gx_clip_path * pcpath)
apath.path_valid = false;
apath.id = gs_next_ids(padev->list_memory, 1); /* path changed => change id */
apath.cached = NULL;
- gx_cpath_assign_free(pcpath, &apath);
- return 0;
+ code = gx_cpath_assign_free(pcpath, &apath);
+ return code;
}
/* Discard an accumulator in case of error. */
diff --git a/base/gxcpath.c b/base/gxcpath.c
index ecdfe0959..4c3d34781 100644
--- a/base/gxcpath.c
+++ b/base/gxcpath.c
@@ -325,8 +325,10 @@ gx_cpath_assign_preserve(gx_clip_path * pcpto, gx_clip_path * pcpfrom)
int code = cpath_alloc_list(&tolist, tolist->rc.memory,
"gx_cpath_assign");
- if (code < 0)
+ if (code < 0) {
+ rc_decrement(pcpto->path.segments, "gx_path_assign");
return code;
+ }
rc_decrement(pcpto->rect_list, "gx_cpath_assign");
} else {
/* Use pcpto's list object. */
@@ -354,7 +356,7 @@ gx_cpath_assign_free(gx_clip_path * pcpto, gx_clip_path * pcpfrom)
int code = gx_cpath_assign_preserve(pcpto, pcpfrom);
if (code < 0)
- return 0;
+ return code;
gx_cpath_free(pcpfrom, "gx_cpath_assign_free");
return 0;
}