diff options
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; |