summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2016-12-22 20:30:19 +0100
committerSebastian Rasmussen <sebras@gmail.com>2016-12-22 20:30:38 +0100
commitd06a844f3e9e38f6cc284f6d3d3a380b814447b4 (patch)
treeb49973ec74eab47997f33acb76baa0726d1e017f /platform
parent26637fc54aa58360cfe3a0049f35ea32dc869309 (diff)
downloadmupdf-d06a844f3e9e38f6cc284f6d3d3a380b814447b4.tar.xz
When document reloading fails, do not leak filename.
Diffstat (limited to 'platform')
-rw-r--r--platform/x11/pdfapp.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c
index 63513415..7de62bf9 100644
--- a/platform/x11/pdfapp.c
+++ b/platform/x11/pdfapp.c
@@ -147,13 +147,10 @@ void pdfapp_invert(pdfapp_t *app, const fz_rect *rect)
void pdfapp_reloadfile(pdfapp_t *app)
{
- fz_context *ctx = app->ctx;
- char *filename = app->docpath;
-
- app->docpath = NULL;
+ char filename[PATH_MAX];
+ fz_strlcpy(filename, app->docpath, PATH_MAX);
pdfapp_close(app);
pdfapp_open(app, filename, 1);
- fz_free(ctx, filename);
}
static void event_cb(fz_context *ctx, pdf_document *doc, pdf_doc_event *event, void *data)