public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Nick Alcock <nix@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] libctf: fix leak in test
Date: Fri, 19 Apr 2024 15:52:30 +0000 (GMT)	[thread overview]
Message-ID: <20240419155231.2A5CC3849AD0@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b5ac272b872db997adc184b23da74f755d4b8f08

commit b5ac272b872db997adc184b23da74f755d4b8f08
Author: Nick Alcock <nick.alcock@oracle.com>
Date:   Wed Apr 3 14:18:25 2024 +0100

    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.

Diff:
---
 libctf/testsuite/libctf-lookup/conflicting-type-syms.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libctf/testsuite/libctf-lookup/conflicting-type-syms.c b/libctf/testsuite/libctf-lookup/conflicting-type-syms.c
index 239b8775964..e328fdf7728 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)

                 reply	other threads:[~2024-04-19 15:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240419155231.2A5CC3849AD0@sourceware.org \
    --to=nix@sourceware.org \
    --cc=binutils-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).