diff options
author | Vicent Marti <tanoku@gmail.com> | 2016-05-24 15:50:44 +0200 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-06-06 15:39:05 -0700 |
commit | 42b07cc9c8d2e6251d190e5ea0d13fd66cb51e6d (patch) | |
tree | 493ffc6b16278c54da28645d96a9359717625576 /src/iterator.c | |
parent | 0eafc0af940646ab581e47e63090c1692a3525aa (diff) |
cmake: Global handler for OOM situations
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/iterator.c b/src/iterator.c index 351b81f..40287f5 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -16,10 +16,7 @@ cmark_iter *cmark_iter_new(cmark_node *root) { if (root == NULL) { return NULL; } - cmark_iter *iter = (cmark_iter *)malloc(sizeof(cmark_iter)); - if (iter == NULL) { - return NULL; - } + cmark_iter *iter = (cmark_iter *)cmark_calloc(1, sizeof(cmark_iter)); iter->root = root; iter->cur.ev_type = CMARK_EVENT_NONE; iter->cur.node = NULL; |