diff options
Diffstat (limited to 'src/cmark.c')
-rw-r--r-- | src/cmark.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmark.c b/src/cmark.c index 0d3bc16..d64237f 100644 --- a/src/cmark.c +++ b/src/cmark.c @@ -12,15 +12,19 @@ const char *cmark_version_string() { return CMARK_VERSION_STRING; } static void *xcalloc(size_t nmem, size_t size) { void *ptr = calloc(nmem, size); - if (!ptr) + if (!ptr) { + fprintf(stderr, "[cmark] calloc returned null pointer, aborting\n"); abort(); + } return ptr; } static void *xrealloc(void *ptr, size_t size) { void *new_ptr = realloc(ptr, size); - if (!new_ptr) + if (!new_ptr) { + fprintf(stderr, "[cmark] realloc returned null pointer, aborting\n"); abort(); + } return new_ptr; } |