objdump print_debugging_info memory leaks
authorAlan Modra <amodra@gmail.com>
Thu, 6 Apr 2023 00:01:08 +0000 (09:31 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 6 Apr 2023 00:22:17 +0000 (09:52 +0930)
commita5f3ca48236a79b0cf78a82dee1cc0241a975eb7
treec07eb48f20c9ef37f84890fe0a2fd7c4b61c4eb8
parentff93c7b1a208996747759c4533d1d7d6acb41bce
objdump print_debugging_info memory leaks

Fix memory leaks and do a general tidy of the code for printing coff
and stabs debug.

* prdbg.c: Delete unnneeded forward function declarations.
Delete unnecessary casts throughout.  Free all strings
returned from pop_type throughout file.
(struct pr_stack): Delete "num_parents".  Replace tests for
"num_parents" non-zero with tests of "parents" non-NULL
throughout.  Free "parents" before assigning, and set to NULL
after freeing.  Remove const from "method".  Always strdup
strings assigned to method, and free before assigning.
(print_debugging_info): Free info.stack and info.filename.
binutils/prdbg.c