From: Florian Weimer Date: Tue, 30 Oct 2018 12:56:40 +0000 (+0100) Subject: stdlib/test-bz22786: Avoid memory leaks in the test itself X-Git-Tag: glibc-2.29~353 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60708030536df82616c16aa2f14f533c4362b969;p=thirdparty%2Fglibc.git stdlib/test-bz22786: Avoid memory leaks in the test itself --- diff --git a/ChangeLog b/ChangeLog index eefe1ce3978..1649229cbb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2018-10-30 Florian Weimer + + * stdlib/test-bz22786.c (do_test): Additional free calls to avoid + memory leaks. + 2018-10-30 Florian Weimer * support/blob_repeat.c (allocate_big): Call mkstemp directly. diff --git a/stdlib/test-bz22786.c b/stdlib/test-bz22786.c index bb1e04f2deb..8035e8a394e 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; }