aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/tree.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-09 13:15:10 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-09 13:15:10 +0100
commit7a994c9631c590d6a73c842fa5d2d3567b4771dd (patch)
tree228ade01f99ba217151a0ed20f29c5f3a5028619 /src/mds-kbdc/tree.c
parentmds-kbdc: compile-layout: macro_call: fix bug: do not duplicate the arguments if there are none (diff)
parentreport an error, rather than causing failure the caller but not for the called function (diff)
downloadmds-7a994c9631c590d6a73c842fa5d2d3567b4771dd.tar.gz
mds-7a994c9631c590d6a73c842fa5d2d3567b4771dd.tar.bz2
mds-7a994c9631c590d6a73c842fa5d2d3567b4771dd.tar.xz
merge track-errors and resolve conflict
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-kbdc/tree.c')
-rw-r--r--src/mds-kbdc/tree.c9
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;