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:
parent
10afcf3896
commit
cf6a998796
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue