diff --git a/binr/rabin2/rabin2.c b/binr/rabin2/rabin2.c index b3b09f2890..b726be1089 100644 --- a/binr/rabin2/rabin2.c +++ b/binr/rabin2/rabin2.c @@ -786,9 +786,11 @@ int main(int argc, char **argv) { } break; case 'h': - r_core_fini (&core); - return rabin_show_help (1); - default: action |= R_BIN_REQ_HELP; + r_core_fini (&core); + return rabin_show_help (1); + default: + action |= R_BIN_REQ_HELP; + break; } } diff --git a/libr/core/cmd_help.c b/libr/core/cmd_help.c index ae0a1b40bd..d84238cdbf 100644 --- a/libr/core/cmd_help.c +++ b/libr/core/cmd_help.c @@ -730,11 +730,17 @@ static int cmd_help(void *data, const char *input) { case 'x': // "?x" for (input++; input[0] == ' '; input++); if (*input == '-') { - ut8 *out = malloc (strlen (input)+1); - int len = r_hex_str2bin (input+1, out); - out[len] = 0; - r_cons_println ((const char*)out); - free (out); + ut8 *out = malloc (strlen (input) + 1); + if (out) { + int len = r_hex_str2bin (input + 1, out); + if (len >= 0) { + out[len] = 0; + r_cons_println ((const char*)out); + } else { + eprintf ("Error parsing the hexpair string\n"); + } + free (out); + } } else if (*input == '+') { ut64 n = r_num_math (core->num, input); int bits = r_num_to_bits (NULL, n) / 8;