libctf: fix use-after-free in function dumping
This is actually a free-before-initializing (i.e. a free of garbage). libctf/ * ctf-dump.c (ctf_dump_funcs): Free in the right place.
This commit is contained in:
parent
a610aa4f9c
commit
941accce38
2 changed files with 5 additions and 1 deletions
|
@ -273,7 +273,6 @@ ctf_dump_funcs (ctf_file_t *fp, ctf_dump_state_t *state)
|
|||
goto err;
|
||||
|
||||
str = ctf_str_append (str, " ");
|
||||
free (bit);
|
||||
|
||||
/* Function name. */
|
||||
|
||||
|
@ -290,6 +289,7 @@ ctf_dump_funcs (ctf_file_t *fp, ctf_dump_state_t *state)
|
|||
}
|
||||
str = ctf_str_append (str, bit);
|
||||
str = ctf_str_append (str, " (");
|
||||
free (bit);
|
||||
|
||||
/* Function arguments. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue