diff options
author | Robin Watts <robin.watts@artifex.com> | 2014-03-04 15:57:54 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2014-03-04 17:02:07 +0000 |
commit | b4ad427e758129321166b8fae2e112e01c39a261 (patch) | |
tree | 2e1532bc75564494b2770d2d6a43437bbc5a5837 | |
parent | 67cdce34a5aeaeae15cbb7228184eecf89ddbe27 (diff) | |
download | mupdf-b4ad427e758129321166b8fae2e112e01c39a261.tar.xz |
Fix memory leaks in pdf-filter code.
We were never freeing the top level filter_gstate, and we were losing
a reference to each new resource type dictionary when we create them.
-rw-r--r-- | source/pdf/pdf-op-filter.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/pdf/pdf-op-filter.c b/source/pdf/pdf-op-filter.c index b938141d..52e38883 100644 --- a/source/pdf/pdf-op-filter.c +++ b/source/pdf/pdf-op-filter.c @@ -59,7 +59,7 @@ static void insert_resource(pdf_csi *csi, pdf_filter_state *state, const char *k xobj = pdf_dict_gets(state->resources, key); if (xobj == NULL) { xobj = pdf_new_dict(csi->doc, 1); - pdf_dict_puts(state->resources, key, xobj); + pdf_dict_puts_drop(state->resources, key, xobj); } pdf_dict_putp(xobj, csi->name, obj); } @@ -1069,6 +1069,7 @@ free_processor_filter(pdf_csi *csi, void *state_) } call_op(csi, state, PDF_OP_END); + fz_free(state->ctx, state->gstate); fz_free(state->ctx, state); } |