Print this page
libconv
*** 20,29 ****
--- 20,30 ----
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2018 Jason King
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
*** 1309,1321 ****
demangled_name(char *s)
{
const char *name;
size_t len;
! name = conv_demangle_name(s);
!
! if (strcmp(name, s) == 0)
return (s);
if (format_buf != NULL)
free(format_buf);
--- 1310,1320 ----
demangled_name(char *s)
{
const char *name;
size_t len;
! if ((name = conv_demangle_name(s)) == s)
return (s);
if (format_buf != NULL)
free(format_buf);
*** 1322,1331 ****
--- 1321,1331 ----
len = strlen(name) + strlen(FORMAT_BUF) + strlen(s) + 1;
format_buf = malloc(len);
if (format_buf == NULL)
return (s);
(void) snprintf(format_buf, len, FORMAT_BUF, name, s);
+ free((void *)name);
return (format_buf);
}
/* getname - get the name of a symbol in a permanent fashion */
static char *