aboutsummaryrefslogtreecommitdiff
path: root/lib/libproc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libproc')
-rw-r--r--lib/libproc/proc_sym.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c
index 4d600436c676..e1776a4e8e7a 100644
--- a/lib/libproc/proc_sym.c
+++ b/lib/libproc/proc_sym.c
@@ -57,21 +57,15 @@ demangle(const char *symbol, char *buf, size_t len)
{
#ifndef NO_CXA_DEMANGLE
char *dembuf;
- size_t demlen;
if (symbol[0] == '_' && symbol[1] == 'Z' && symbol[2]) {
- dembuf = malloc(len);
- if (!dembuf)
- goto fail;
- demlen = len;
- dembuf = __cxa_demangle(symbol, dembuf, &demlen, NULL);
+ dembuf = __cxa_demangle(symbol, NULL, NULL, NULL);
if (!dembuf)
goto fail;
strlcpy(buf, dembuf, len);
free(dembuf);
+ return;
}
-
- return;
fail:
#endif /* NO_CXA_DEMANGLE */
strlcpy(buf, symbol, len);