From patchwork Tue Oct 30 17:25:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 29962 Received: (qmail 96301 invoked by alias); 30 Oct 2018 17:25:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 95936 invoked by uid 89); 30 Oct 2018 17:25:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Additional X-HELO: mx1.redhat.com Date: Tue, 30 Oct 2018 18:25:04 +0100 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] stdlib/test-bz22786: Avoid memory leaks in the test itself User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20181030172504.2C22C4399457D@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2018-10-30 Florian Weimer * 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; }