mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-29 02:07:39 +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
|
if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
|
||||||
&& byte_order != __BIG_ENDIAN)
|
&& byte_order != __BIG_ENDIAN)
|
||||||
|
{
|
||||||
|
free(as);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Default to little-endian for ARM. */
|
/* Default to little-endian for ARM. */
|
||||||
if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
|
if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
|
||||||
|
|
Loading…
Reference in a new issue