public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
* [2.28 COMMITTED] stdlib/test-bz22786: Avoid memory leaks in the test itself
@ 2018-01-01  0:00 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2018-01-01  0:00 UTC (permalink / raw)
  To: libc-stable

(cherry picked from commit 60708030536df82616c16aa2f14f533c4362b969)

2018-10-30  Florian Weimer  <fweimer@redhat.com>

	* stdlib/test-bz22786.c (do_test): Additional free calls to avoid
	memory leaks.

diff --git a/stdlib/test-bz22786.c b/stdlib/test-bz22786.c
index bb1e04f2de..8035e8a394 100644
--- a/stdlib/test-bz22786.c
+++ b/stdlib/test-bz22786.c
@@ -36,8 +36,8 @@
 static int
 do_test (void)
 {
-  const char *dir = support_create_temp_directory ("bz22786.");
-  const char *lnk = xasprintf ("%s/symlink", dir);
+  char *dir = support_create_temp_directory ("bz22786.");
+  char *lnk = xasprintf ("%s/symlink", dir);
   const size_t path_len = (size_t) INT_MAX + strlen (lnk) + 1;
 
   struct support_blob_repeat repeat
@@ -72,6 +72,8 @@ do_test (void)
   /* Cleanup.  */
   unlink (lnk);
   support_blob_repeat_free (&repeat);
+  free (lnk);
+  free (dir);
 
   return 0;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-11-02  9:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-01  0:00 [2.28 COMMITTED] stdlib/test-bz22786: Avoid memory leaks in the test itself Florian Weimer

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).