libctf: fix memory leak in a test
authorNick Alcock <nick.alcock@oracle.com>
Thu, 25 Mar 2021 16:32:46 +0000 (16:32 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 25 Mar 2021 16:32:50 +0000 (16:32 +0000)
Harmless, but causes noise that makes it harder to spot other leaks.

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

* testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't
leak buf.

libctf/ChangeLog
libctf/testsuite/libctf-writable/symtypetab-nonlinker-writeout.c

index c5d52f29d69834bad8ebb2714d5219ac13f7b469..d4a94bb27ce6bb3735a6c9e6b1cb60d3be3ffd3f 100644 (file)
@@ -1,3 +1,8 @@
+2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
+
+       * testsuite/libctf-writable/symtypetab-nonlinker-writeout.c: Don't
+       leak buf.
+
 2021-03-25  Nick Alcock  <nick.alcock@oracle.com>
 
        PR libctf/27628
index 98144de639130584a5208846bf2d198c21d7ecc9..bdc3faa944ca729cc84dd80b1132540293f20a88 100644 (file)
@@ -202,6 +202,7 @@ try_maybe_reporting (int report)
     }
 
   ctf_file_close (fp);
+  free (buf);
 
   return;