From 829e0c495f83939a795c527fcf713fb12244ce8d Mon Sep 17 00:00:00 2001 From: hpi1 Date: Tue, 2 Jul 2019 11:21:14 +0300 Subject: [PATCH] Check for NULL --- src/examples/bd_info.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/examples/bd_info.c b/src/examples/bd_info.c index 3ca2ada1..d435e1f0 100644 --- a/src/examples/bd_info.c +++ b/src/examples/bd_info.c @@ -52,6 +52,8 @@ static const char *_hex2str(const uint8_t *data, size_t len) size_t i; str = (char*)realloc(str, 2*len + 1); + if (!str) + return ""; *str = 0; for (i = 0; i < len; i++) {