diff options
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r-- | libiberty/cplus-dem.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index e94848767e7..2dd0a8a5c84 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -1175,6 +1175,11 @@ internal_cplus_demangle (struct work_stuff *work, const char *mangled) if ((AUTO_DEMANGLING || GNU_DEMANGLING)) { success = gnu_special (work, &mangled, &decl); + if (!success) + { + delete_work_stuff (work); + string_delete (&decl); + } } if (!success) { @@ -1218,10 +1223,12 @@ squangle_mop_up (struct work_stuff *work) if (work -> btypevec != NULL) { free ((char *) work -> btypevec); + work->btypevec = NULL; } if (work -> ktypevec != NULL) { free ((char *) work -> ktypevec); + work->ktypevec = NULL; } } |