aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/tree.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-08 22:39:07 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-08 22:39:07 +0100
commit2064b68718ea5f15de76d661ae1f307d67a0cf26 (patch)
tree3b8f93932cb4a13ab6001f165de7714ec7e86848 /src/mds-kbdc/tree.c
parentupdate the texinfo manual for the new use of fail_if (diff)
downloadmds-2064b68718ea5f15de76d661ae1f307d67a0cf26.tar.gz
mds-2064b68718ea5f15de76d661ae1f307d67a0cf26.tar.bz2
mds-2064b68718ea5f15de76d661ae1f307d67a0cf26.tar.xz
with a few exceptions and some remaining files, never return directly on failure, always goto fail by invoking fail_if
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-kbdc/tree.c')
-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;
}