summaryrefslogtreecommitdiff
path: root/usr/src/lib/libctf/common
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2020-11-10 23:31:51 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2020-11-12 21:15:20 +0000
commita676209deb2ce5d0c98f331659de25e2483f8c4c (patch)
treeee2f5ed90711752a745594283ac1da73feb4bd84 /usr/src/lib/libctf/common
parenteffb27ee30c48fe502152c38487ced379d9f8693 (diff)
downloadillumos-joyent-a676209deb2ce5d0c98f331659de25e2483f8c4c.tar.gz
13252 ctf_update()/ctf_dwarf_convert_function() leak memory
Reviewed by: Robert Mustacchi <rm@fingolfin.org> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libctf/common')
-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);
}