summaryrefslogtreecommitdiff
path: root/stdlib/test-bz22786.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2018-10-30 13:56:40 +0100
committerFlorian Weimer <fweimer@redhat.com>2018-10-30 13:56:40 +0100
commit60708030536df82616c16aa2f14f533c4362b969 (patch)
tree232fa1e8c5410674a9413ee6543fba3b45051ad1 /stdlib/test-bz22786.c
parenta91e9301c47bb688f4e496a19cfc68261ff18293 (diff)
downloadglibc-60708030536df82616c16aa2f14f533c4362b969.tar.gz
stdlib/test-bz22786: Avoid memory leaks in the test itself
Diffstat (limited to 'stdlib/test-bz22786.c')
-rw-r--r--stdlib/test-bz22786.c6
1 files changed, 4 insertions, 2 deletions
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;
}