summaryrefslogtreecommitdiff
path: root/usr/src/lib/libctf/common/ctf_dwarf.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libctf/common/ctf_dwarf.c')
-rw-r--r--usr/src/lib/libctf/common/ctf_dwarf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr/src/lib/libctf/common/ctf_dwarf.c b/usr/src/lib/libctf/common/ctf_dwarf.c
index e2cd9414dc..8163b145e4 100644
--- a/usr/src/lib/libctf/common/ctf_dwarf.c
+++ b/usr/src/lib/libctf/common/ctf_dwarf.c
@@ -2290,8 +2290,10 @@ ctf_dwarf_convert_function(ctf_cu_t *cup, Dwarf_Die die)
name, ctf_die_offset(cup, die));
if ((ret = ctf_dwarf_boolean(cup, die, DW_AT_declaration, &b)) != 0) {
- if (ret != ENOENT)
+ if (ret != ENOENT) {
+ ctf_free(name, strlen(name) + 1);
return (ret);
+ }
} else if (b != 0) {
/*
* GCC7 at least creates empty DW_AT_declarations for functions
@@ -2302,6 +2304,7 @@ ctf_dwarf_convert_function(ctf_cu_t *cup, Dwarf_Die die)
*/
ctf_dprintf("ignoring declaration of function %s (die %llx)\n",
name, ctf_die_offset(cup, die));
+ ctf_free(name, strlen(name) + 1);
return (0);
}