From b255b35feb80ecf096825395e01bccd34ee02b2b Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Tue, 9 Jun 2020 10:45:07 +0100 Subject: libctf, decl: avoid leaks of the formatted string on error ctf_decl_sprintf builds up a formatted string in the ctf_decl_t's cd_buf, but then on error this is hardly ever freed: we assume that ctf_decl_fini frees it, but it leaks it instead. Make it free it like any decent ADT should. libctf/ * ctf-decl.c (ctf_decl_fini): Free the cd_buf. (ctf_decl_buf): Once it escapes, don't try to free it later. --- libctf/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libctf/ChangeLog') diff --git a/libctf/ChangeLog b/libctf/ChangeLog index 288ad6e..d840bc4 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,10 @@ 2020-07-22 Nick Alcock + * ctf-decl.c (ctf_decl_fini): Free the cd_buf. + (ctf_decl_buf): Once it escapes, don't try to free it later. + +2020-07-22 Nick Alcock + * ctf-types.c (ctf_type_aname): Print arg types here... * ctf-dump.c (ctf_dump_funcs): ... not here: but do substitute in the type name here. -- cgit v1.1