summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2014-07-24 17:10:39 +1000
committerChris Johns <chrisj@rtems.org>2014-07-24 17:10:39 +1000
commit0b81accba708e028d3e9828522907ca4fda77125 (patch)
treec8576cf7342e86423b60d84e603f6c2e310a5518
parent97a3d78f92fa29d18647d8d3f5f0a4f0a21cb393 (diff)
Free memory after printing the error message.
Reported by Serg Kruglov <skruglov@nm.ru> on the user@rtems.org list.
-rw-r--r--rtl-rap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rtl-rap.c b/rtl-rap.c
index be11fe9..f96bce7 100644
--- a/rtl-rap.c
+++ b/rtl-rap.c
@@ -616,12 +616,12 @@ rtems_rtl_rap_load_symbols (rtems_rtl_rap_t* rap, rtems_rtl_obj_t* obj)
if (rtems_rtl_symbol_global_find (rap->strtab + name) &&
(ELF_ST_BIND (data & 0xffff) != STB_WEAK))
{
+ rtems_rtl_set_error (EINVAL,
+ "duplicate global symbol: %s", rap->strtab + name);
free (obj->global_table);
obj->global_table = NULL;
obj->global_syms = 0;
obj->global_size = 0;
- rtems_rtl_set_error (EINVAL,
- "duplicate global symbol: %s", rap->strtab + name);
return false;
}