summaryrefslogtreecommitdiff
path: root/source/html
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-01-22 11:12:36 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-01-22 11:35:29 +0100
commitb31c7d1559125b5a0c596e52d632c70e48c506cf (patch)
tree515f80e90c827f7aa2dd18a049129d1baecced4f /source/html
parent6625a5b82671df7e79afc69a2ba366fb64df03a9 (diff)
downloadmupdf-b31c7d1559125b5a0c596e52d632c70e48c506cf.tar.xz
epub: Fix memory leak of bidi detection scratch buffer.
Diffstat (limited to 'source/html')
-rw-r--r--source/html/html-layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index 36995c34..42222bdd 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -1576,7 +1576,12 @@ detect_directionality(fz_context *ctx, fz_pool *pool, fz_html *box)
{
uni_buf buffer = { NULL };
- detect_box_directionality(ctx, pool, &buffer, box);
+ fz_try(ctx)
+ detect_box_directionality(ctx, pool, &buffer, box);
+ fz_always(ctx)
+ fz_free(ctx, buffer.data);
+ fz_catch(ctx)
+ fz_rethrow(ctx);
}
fz_html *