Check for NULL
This commit is contained in:
parent
21f15d2f58
commit
829e0c495f
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue