1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-11-25 08:37:38 +01:00

Fix memory leak in ARM unw_create_addr_space()

Frees newly created address space memory in the event of a failure
caused by an endian mismatch.

Signed-off-by: Zachary T Welch <zwelch@codesourcery.com>
This commit is contained in:
Zachary T Welch 2010-10-28 16:25:48 -07:00 committed by Arun Sharma
parent 10afcf3896
commit cf6a998796

View file

@ -46,7 +46,10 @@ unw_create_addr_space (unw_accessors_t *a, int byte_order)
*/
if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
&& byte_order != __BIG_ENDIAN)
{
free(as);
return NULL;
}
/* Default to little-endian for ARM. */
if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)