diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-08 22:39:07 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-08 22:39:07 +0100 |
commit | 2064b68718ea5f15de76d661ae1f307d67a0cf26 (patch) | |
tree | 3b8f93932cb4a13ab6001f165de7714ec7e86848 /src/mds-kbdc/tree.c | |
parent | update the texinfo manual for the new use of fail_if (diff) | |
download | mds-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.c | 7 |
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; } |