aboutsummaryrefslogtreecommitdiff
path: root/gdb/demangle.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/demangle.c')
-rw-r--r--gdb/demangle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/demangle.c b/gdb/demangle.c
index 4b5bc9b..0104d8f 100644
--- a/gdb/demangle.c
+++ b/gdb/demangle.c
@@ -186,7 +186,7 @@ _initialize_demangler (void)
libiberty_demanglers[ndems].demangling_style != unknown_demangling;
ndems++)
;
- demangling_style_names = xmalloc (ndems * sizeof (char *));
+ demangling_style_names = xcalloc (ndems + 1, sizeof (char *));
for (i = 0;
libiberty_demanglers[i].demangling_style != unknown_demangling;
i++)