aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2011-03-25 16:38:27 +0000
committerDJ Delorie <dj@redhat.com>2011-03-25 16:38:27 +0000
commitd0f0b69d106989973b8924276a7c48f75b716258 (patch)
treecb05ce1b1186fdc2c22bf04204a36ab5cd95225e /libiberty/cplus-dem.c
parentbb0c92378b56899de9232b6b099e76597589afde (diff)
downloadgdb-d0f0b69d106989973b8924276a7c48f75b716258.zip
gdb-d0f0b69d106989973b8924276a7c48f75b716258.tar.gz
gdb-d0f0b69d106989973b8924276a7c48f75b716258.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 6cd9a41..84f94b6 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -883,7 +883,7 @@ ada_demangle (const char *mangled, int option ATTRIBUTE_UNUSED)
int len0;
const char* p;
char *d;
- char *demangled = NULL;
+ char *demangled;
/* Discard leading _ada_, which is used for library level subprograms. */
if (strncmp (mangled, "_ada_", 5) == 0)
@@ -1129,11 +1129,10 @@ ada_demangle (const char *mangled, int option ATTRIBUTE_UNUSED)
unknown:
len0 = strlen (mangled);
- free (demangled);
demangled = XNEWVEC (char, len0 + 3);
if (mangled[0] == '<')
- strcpy (demangled, mangled);
+ strcpy (demangled, mangled);
else
sprintf (demangled, "<%s>", mangled);