diff options
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/tree.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mds-kbdc/tree.c b/src/mds-kbdc/tree.c index ccd66d4..6ee98c1 100644 --- a/src/mds-kbdc/tree.c +++ b/src/mds-kbdc/tree.c @@ -60,11 +60,12 @@ void mds_kbdc_tree_initialise(mds_kbdc_tree_t* restrict this, int type) */ mds_kbdc_tree_t* mds_kbdc_tree_create(int type) { - mds_kbdc_tree_t* this = malloc(sizeof(mds_kbdc_tree_t)); - if (this == NULL) - return NULL; + mds_kbdc_tree_t* this; + fail_if (xmalloc(this, 1, mds_kbdc_tree_t)); mds_kbdc_tree_initialise(this, type); return this; + fail: + return NULL; } @@ -331,7 +332,7 @@ mds_kbdc_tree_t* mds_kbdc_tree_dup(const mds_kbdc_tree_t* restrict this) node = &(n->next); goto again; - pfail: + fail: saved_errno = errno; mds_kbdc_tree_free(rc); return errno = saved_errno, NULL; |