aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/tree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mds-kbdc/tree.c b/src/mds-kbdc/tree.c
index ac9de2b..b32c503 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;
}