aboutsummaryrefslogtreecommitdiff
path: root/libctf/testsuite
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2024-04-03 14:18:25 +0100
committerNick Alcock <nick.alcock@oracle.com>2024-04-19 16:14:47 +0100
commitb5ac272b872db997adc184b23da74f755d4b8f08 (patch)
tree73ed06bf2a45155b9def2e43611fb07768e619ab /libctf/testsuite
parent3b5e2d0e8d55fd61c8b0f7aaf61b6b097654a5c1 (diff)
downloadgdb-b5ac272b872db997adc184b23da74f755d4b8f08.zip
gdb-b5ac272b872db997adc184b23da74f755d4b8f08.tar.gz
gdb-b5ac272b872db997adc184b23da74f755d4b8f08.tar.bz2
libctf: fix leak in test
This purely serves to make it easier to interpret valgrind output. No functional effect. libctf/ * testsuite/libctf-lookup/conflicting-type-syms.c: Free everything.
Diffstat (limited to 'libctf/testsuite')
-rw-r--r--libctf/testsuite/libctf-lookup/conflicting-type-syms.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libctf/testsuite/libctf-lookup/conflicting-type-syms.c b/libctf/testsuite/libctf-lookup/conflicting-type-syms.c
index 239b877..e328fdf 100644
--- a/libctf/testsuite/libctf-lookup/conflicting-type-syms.c
+++ b/libctf/testsuite/libctf-lookup/conflicting-type-syms.c
@@ -27,18 +27,22 @@ main (int argc, char *argv[])
if ((a_fp = ctf_arc_lookup_symbol_name (ctf, "a", &a, &err)) == NULL)
goto sym_err;
printf ("Type of a is %s\n", foo = ctf_type_aname (a_fp, a));
+ free (foo);
if ((b_fp = ctf_arc_lookup_symbol_name (ctf, "b", &b, &err)) == NULL)
goto sym_err;
printf ("Type of b is %s\n", foo = ctf_type_aname (b_fp, b));
+ free (foo);
if ((ignore1_fp = ctf_arc_lookup_symbol_name (ctf, "ignore1", &ignore1, &err)) == NULL)
goto sym_err;
printf ("Type of ignore1 is %s\n", foo = ctf_type_aname (ignore1_fp, ignore1));
+ free (foo);
if ((ignore2_fp = ctf_arc_lookup_symbol_name (ctf, "ignore2", &ignore2, &err)) == NULL)
goto sym_err;
printf ("Type of ignore2 is %s\n", foo = ctf_type_aname (ignore2_fp, ignore1));
+ free (foo);
/* Try a call in just-get-the-dict mode and make sure it doesn't fail. */
if ((tmp_fp = ctf_arc_lookup_symbol_name (ctf, "ignore2", NULL, &err)) == NULL)