Fix memleak and null deref in types
This commit is contained in:
parent
92e9604f6a
commit
9b91799591
|
@ -216,6 +216,7 @@ R_API void r_core_anal_type_match(RCore *core, RAnalFunction *fcn) {
|
|||
int *previnstr = calloc (MAXINSTR + 1, sizeof (int));
|
||||
if (!previnstr) {
|
||||
eprintf ("Cannot allocate %d byte(s)\n", MAXINSTR + 1);
|
||||
free (buf);
|
||||
return;
|
||||
}
|
||||
r_cons_break_push (NULL, NULL);
|
||||
|
|
|
@ -481,6 +481,9 @@ R_API char *r_type_func_guess(Sdb *TDB, char *func_name) {
|
|||
// also try module.dll_function and function_number
|
||||
if ((first = strchr (str, '_'))) {
|
||||
last = (char *)r_str_lchr (first, '_');
|
||||
if (!last) {
|
||||
goto out;
|
||||
}
|
||||
// middle + suffix or right half
|
||||
if ((result = type_func_try_guess (TDB, first + 1))) {
|
||||
goto out;
|
||||
|
|
Loading…
Reference in New Issue