From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2103) id 2A5CC3849AD0; Fri, 19 Apr 2024 15:52:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A5CC3849AD0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713541951; bh=0GXGvSzFEO0qqf1F3dO4AO2G5TDrjKmdgnYN0U8K+x8=; h=From:To:Subject:Date:From; b=B7SFq/HyGxpLtHuhKfaNpgqpVadrerTDJPdrkZqpC+ayl0l8Dvofe77RHWqIB9oil tJZfH0fXz3M4kTLcZGB80h9zXS9yPriVCiBsX6X3wJy32Jct6w9cs485uDaQOLqgWj y7SVv7fPIDkUV4bYnmqbQPf/zZUbhzAxrzwTtybk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Nick Alcock To: binutils-cvs@sourceware.org Subject: [binutils-gdb] libctf: fix leak in test X-Act-Checkin: binutils-gdb X-Git-Author: Nick Alcock X-Git-Refname: refs/heads/master X-Git-Oldrev: 3b5e2d0e8d55fd61c8b0f7aaf61b6b097654a5c1 X-Git-Newrev: b5ac272b872db997adc184b23da74f755d4b8f08 Message-Id: <20240419155231.2A5CC3849AD0@sourceware.org> Date: Fri, 19 Apr 2024 15:52:30 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db5ac272b872d= b997adc184b23da74f755d4b8f08 commit b5ac272b872db997adc184b23da74f755d4b8f08 Author: Nick Alcock Date: Wed Apr 3 14:18:25 2024 +0100 libctf: fix leak in test =20 This purely serves to make it easier to interpret valgrind output. No functional effect. =20 libctf/ * testsuite/libctf-lookup/conflicting-type-syms.c: Free everyth= ing. 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/libct= f/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 =3D ctf_arc_lookup_symbol_name (ctf, "a", &a, &err)) =3D=3D NU= LL) goto sym_err; printf ("Type of a is %s\n", foo =3D ctf_type_aname (a_fp, a)); + free (foo); =20 if ((b_fp =3D ctf_arc_lookup_symbol_name (ctf, "b", &b, &err)) =3D=3D NU= LL) goto sym_err; printf ("Type of b is %s\n", foo =3D ctf_type_aname (b_fp, b)); + free (foo); =20 if ((ignore1_fp =3D ctf_arc_lookup_symbol_name (ctf, "ignore1", &ignore1= , &err)) =3D=3D NULL) goto sym_err; printf ("Type of ignore1 is %s\n", foo =3D ctf_type_aname (ignore1_fp, i= gnore1)); + free (foo); =20 if ((ignore2_fp =3D ctf_arc_lookup_symbol_name (ctf, "ignore2", &ignore2= , &err)) =3D=3D NULL) goto sym_err; printf ("Type of ignore2 is %s\n", foo =3D ctf_type_aname (ignore2_fp, i= gnore1)); + free (foo); =20 /* Try a call in just-get-the-dict mode and make sure it doesn't fail. = */ if ((tmp_fp =3D ctf_arc_lookup_symbol_name (ctf, "ignore2", NULL, &err))= =3D=3D NULL)