From d4b066cf6cad40b4a35a92d70ae39246b96872f8 Mon Sep 17 00:00:00 2001 From: malc Date: Sun, 2 Dec 2012 22:28:56 +0400 Subject: [PATCH] Emit a warning message if strdup of trimcachepath fails --- link.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/link.c b/link.c index 1c384b9..a7e91b3 100644 --- a/link.c +++ b/link.c @@ -3514,6 +3514,10 @@ CAMLprim value ml_init (value pipe_v, value params_v) colorspace = Int_val (Field (params_v, 6)); fontpath = String_val (Field (params_v, 7)); state.trimcachepath = strdup (String_val (Field (params_v, 8))); + if (!state.trimcachepath) { + fprintf (stderr, "failed to strdup trimcachepath: %s\n", + strerror (errno)); + } haspboext = Bool_val (Field (params_v, 9)); state.ctx = fz_new_context (NULL, NULL, mustoresize); -- 2.11.4.GIT