Skip to content
Commit 80aa6647 authored by Alan Modra's avatar Alan Modra
Browse files

Fix mmo memory leaks

The main one here is the section buffer, which can be quite large.
By using alloc rather than malloc we can leave tidying memory to the
generic bfd code when the bfd is closed.  bfd_check_format also
releases memory when object_p fails, so while it wouldn't be wrong
to bfd_release at bad_format_free in mmo_object_p, it's a little extra
code and work for no gain.

	* mmo.c (mmo_object_p): bfd_alloc rather than bfd_malloc
	lop_stab_symbol.  Don't free/release on error.
	(mmo_get_spec_section): bfd_zalloc rather than bfd_zmalloc
	section buffer.
	(mmo_scan): Free fname on another error path.
parent fe8cdc8e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment