From 103dda29f38529874d74965872457a61f6bad3a9 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Sat, 29 Dec 2018 16:39:52 +0100 Subject: [PATCH] [misc] Move CHECK_NULL inside b64_decode (around the malloc) To stay in line with general use of the macro --- src/inputs/pipe.c | 2 +- src/misc.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/inputs/pipe.c b/src/inputs/pipe.c index 621f04af..99c1685a 100644 --- a/src/inputs/pipe.c +++ b/src/inputs/pipe.c @@ -417,7 +417,7 @@ parse_item(struct input_metadata *m, const char *item) if (data != &progress && data != &volume) free(*data); - CHECK_NULL(L_PLAYER, *data = b64_decode(s)); + *data = b64_decode(s); DPRINTF(E_DBG, L_PLAYER, "Read Shairport metadata (type=%8x, code=%8x): '%s'\n", type, code, *data); diff --git a/src/misc.c b/src/misc.c index 5bfed5d8..f74fe924 100644 --- a/src/misc.c +++ b/src/misc.c @@ -738,9 +738,7 @@ b64_decode(const char *b64) len = strlen(b64); - str = (char *)malloc(len); - if (!str) - return NULL; + CHECK_NULL(L_MISC, str = malloc(len)); memset(str, 0, len);