[6/8] libctf: fix memory leak in a test

Message ID 20210324012158.35472-6-nick.alcock@oracle.com
State New
Headers show
Series
  • [1/8] libctf, dump: do not emit size or alignment if it would error
Related show

Commit Message

Alan Modra via Binutils March 24, 2021, 1:21 a.m.
Harmless, but causes noise that makes it harder to spot other leaks.

libctf/ChangeLog
2021-03-23  Nick Alcock  <nick.alcock@oracle.com>

	* testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't
	leak buf.
---
 libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.31.0.253.gdec51257f3

Patch

diff --git a/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c b/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
index 98144de6391..bdc3faa944c 100644
--- a/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
+++ b/libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c
@@ -202,6 +202,7 @@  try_maybe_reporting (int report)
     }
 
   ctf_file_close (fp);
+  free (buf);
 
   return;