]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
stdlib/test-bz22786: Avoid memory leaks in the test itself
authorFlorian Weimer <fweimer@redhat.com>
Tue, 30 Oct 2018 12:56:40 +0000 (13:56 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Fri, 2 Nov 2018 09:47:16 +0000 (10:47 +0100)
(cherry picked from commit 60708030536df82616c16aa2f14f533c4362b969)

ChangeLog
stdlib/test-bz22786.c

index 2043b21ddeacdd8f4a8c654a814132ffb2661579..a2a9fc3cc9283031c15c9883dba898884a1b1d26 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-30  Florian Weimer  <fweimer@redhat.com>
+
+       * stdlib/test-bz22786.c (do_test): Additional free calls to avoid
+       memory leaks.
+
 2018-10-30  Florian Weimer  <fweimer@redhat.com>
 
        Avoid spurious test failures in stdlib/test-bz22786.
index bb1e04f2debe9042f813ac3272ce96f3be53a950..8035e8a394e7d034b34173102463cbee08cf65de 100644 (file)
@@ -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;
 }