summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2016-05-24 15:50:44 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2016-06-06 15:39:05 -0700
commit42b07cc9c8d2e6251d190e5ea0d13fd66cb51e6d (patch)
tree493ffc6b16278c54da28645d96a9359717625576 /src/iterator.c
parent0eafc0af940646ab581e47e63090c1692a3525aa (diff)
cmake: Global handler for OOM situations
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c5
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;