summaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorMatthew Gingell <gingell@adacore.com>2009-09-23 08:08:40 +0000
committerTristan Gingold <gingold@gcc.gnu.org>2009-09-23 08:08:40 +0000
commit30b639a8453177e071582d070321627a10291427 (patch)
treec47cc305c00ae57d028f93dcaa770c3a8c5590e9 /libiberty/cplus-dem.c
parent457ff6a1d01865e2134912402a674d30ec898d76 (diff)
downloadgcc-30b639a8453177e071582d070321627a10291427.tar.gz
cplus-dem.c (ada_demangle): Ensure demangled is freed.
2009-09-23 Matthew Gingell <gingell@adacore.com> * cplus-dem.c (ada_demangle): Ensure demangled is freed. From-SVN: r152060
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 41674675366..66285141ffa 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -984,7 +984,10 @@ ada_demangle (const char *mangled, int option ATTRIBUTE_UNUSED)
goto Suppress;
if (! changed)
- return NULL;
+ {
+ free (demangled);
+ return NULL;
+ }
else
return demangled;