mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-08-15 11:27:35 +00:00
dyngen: Don't leak already malloc'ed demangled_name
This commit is contained in:
committed by
Alexei Svitkine
parent
fd78a64ade
commit
612761981f
@@ -2885,8 +2885,10 @@ int gen_file(FILE *outfile, int out_type)
|
||||
char *demangled_name, *func_name;
|
||||
if ((demangled_name = malloc(nd)) == NULL)
|
||||
return -1;
|
||||
if ((func_name = malloc(nf = nd)) == NULL)
|
||||
if ((func_name = malloc(nf = nd)) == NULL) {
|
||||
free(demangled_name);
|
||||
return -1;
|
||||
}
|
||||
|
||||
fprintf(outfile, "#ifndef DEFINE_CST\n");
|
||||
fprintf(outfile, "#define DEFINE_CST(NAME, VALUE)\n");
|
||||
|
Reference in New Issue
Block a user