From c5918f8ec97a9e914666da4a4b4da5bb81f9a77c Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Wed, 12 Oct 2011 18:31:33 +0200 Subject: Make sure PDF title is always an allocated string. Signed-off-by: Sebastian Rasmussen --- apps/pdfapp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/pdfapp.c b/apps/pdfapp.c index e96b94e6..3050145f 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -139,7 +139,7 @@ static void pdfapp_open_pdf(pdfapp_t *app, char *filename, int fd) app->outline = pdf_load_outline(app->xref); - app->doctitle = filename; + app->doctitle = fz_strdup(filename); if (strrchr(app->doctitle, '\\')) app->doctitle = strrchr(app->doctitle, '\\') + 1; if (strrchr(app->doctitle, '/')) @@ -174,7 +174,7 @@ static void pdfapp_open_xps(pdfapp_t *app, char *filename, int fd) pdfapp_error(app, fz_rethrow(error, "cannot open document '%s'", filename)); fz_close(file); - app->doctitle = filename; + app->doctitle = fz_strdup(filename); app->pagecount = xps_count_pages(app->xps); } -- cgit v1.2.3