From 0b81accba708e028d3e9828522907ca4fda77125 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Thu, 24 Jul 2014 17:10:39 +1000 Subject: Free memory after printing the error message. Reported by Serg Kruglov on the user@rtems.org list. --- rtl-rap.c | 4 ++-- 1 file 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; } -- cgit v1.2.3