From b31c7d1559125b5a0c596e52d632c70e48c506cf Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 22 Jan 2016 11:12:36 +0100 Subject: epub: Fix memory leak of bidi detection scratch buffer. --- source/html/html-layout.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/html') 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 * -- cgit v1.2.3