summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-11-28 04:44:58 +0100
committerTor Andersson <tor@ghostscript.com>2009-11-28 04:44:58 +0100
commit61666e7f6b1d2e839d43068d5c84c987e28ec859 (patch)
treef3a3f019ee8f7c962472e00ac35e466d2a58468a /apps
parenta16d9e0c25ed986c57c521aa87d87f6c343218a7 (diff)
downloadmupdf-61666e7f6b1d2e839d43068d5c84c987e28ec859.tar.xz
Malloc cannot return null. Clean up in mupdf resource code.
Diffstat (limited to 'apps')
-rw-r--r--apps/common/pdfapp.c5
-rw-r--r--apps/common/pdftool.c5
2 files changed, 2 insertions, 8 deletions
diff --git a/apps/common/pdfapp.c b/apps/common/pdfapp.c
index 935f79f4..96eeae00 100644
--- a/apps/common/pdfapp.c
+++ b/apps/common/pdfapp.c
@@ -77,10 +77,7 @@ void pdfapp_open(pdfapp_t *app, char *filename)
app->filename = filename;
- error = pdf_newxref(&app->xref);
- if (error)
- pdfapp_error(app, error);
-
+ app->xref = pdf_newxref();
error = pdf_loadxref(app->xref, filename);
if (error)
{
diff --git a/apps/common/pdftool.c b/apps/common/pdftool.c
index 772fc9a0..4d846df5 100644
--- a/apps/common/pdftool.c
+++ b/apps/common/pdftool.c
@@ -33,10 +33,7 @@ void openxref(char *filename, char *password, int dieonbadpass)
else
basename++;
- error = pdf_newxref(&xref);
- if (error)
- die(error);
-
+ xref = pdf_newxref();
error = pdf_loadxref(xref, filename);
if (error)
{