mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-11 10:30:09 +00:00
dyngen: Don't leak func_name on realloc and fix indentation.
This commit is contained in:
parent
668b8f14ba
commit
a3a45f54e9
@ -2941,11 +2941,13 @@ int gen_file(FILE *outfile, int out_type)
|
||||
if (p && !strstart(p, "()::label", NULL)) {
|
||||
int func_name_length = p - demangled_name;
|
||||
if (nd > nf) {
|
||||
char *new_func_name;
|
||||
nf = nd;
|
||||
if ((func_name = realloc(func_name, nf)) == NULL) {
|
||||
if ((new_func_name = realloc(func_name, nf)) == NULL) {
|
||||
free(func_name);
|
||||
return -1;
|
||||
}
|
||||
func_name = new_func_name;
|
||||
}
|
||||
strncpy(func_name, demangled_name, func_name_length);
|
||||
func_name[func_name_length] = '\0';
|
||||
|
Loading…
x
Reference in New Issue
Block a user