From 017a61683b57ab320a5d868eadc9ad01fbcb8613 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 7 Jun 2015 16:41:20 +0200 Subject: [PATCH] xmb_node_allocate_userdata - cleanups --- menu/drivers/xmb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 07d9af9c32..7444a683ad 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -634,19 +634,14 @@ static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, if (!info) return NULL; - info->userdata = (xmb_node_t*)calloc(1, sizeof(xmb_node_t)); + node = (xmb_node_t*)calloc(1, sizeof(xmb_node_t)); - if (!info->userdata) + if (!node) { RARCH_ERR("XMB node could not be allocated.\n"); return NULL; } - node = (xmb_node_t*)info->userdata; - - if (!node) - return NULL; - node->alpha = xmb->categories.passive.alpha; node->zoom = xmb->categories.passive.zoom; @@ -656,6 +651,8 @@ static xmb_node_t *xmb_node_allocate_userdata(xmb_handle_t *xmb, node->zoom = xmb->categories.active.zoom; } + info->userdata = node; + return node; }