From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88485 invoked by alias); 2 Nov 2018 09:51:02 -0000 Mailing-List: contact libc-stable-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: List-Archive: Sender: libc-stable-owner@sourceware.org Received: (qmail 88453 invoked by uid 89); 2 Nov 2018 09:51:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.2 on sourceware.org X-Virus-Found: No 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=Hx-languages-length:929 X-Spam-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 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on sourceware.org X-Spam-Level: X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Nov 2018 09:51:00 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B34C5C049589 for ; Fri, 2 Nov 2018 09:50:59 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-117-198.ams2.redhat.com [10.36.117.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DCFD100164E for ; Fri, 2 Nov 2018 09:50:59 +0000 (UTC) Received: by oldenburg.str.redhat.com (Postfix, from userid 1000) id 8057B4399457D; Fri, 2 Nov 2018 10:50:56 +0100 (CET) Date: Mon, 01 Jan 2018 00:00:00 -0000 To: libc-stable@sourceware.org Subject: [2.28 COMMITTED] stdlib/test-bz22786: Avoid memory leaks in the test itself User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20181102095056.8057B4399457D@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 02 Nov 2018 09:50:59 +0000 (UTC) X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00005.txt.bz2 (cherry picked from commit 60708030536df82616c16aa2f14f533c4362b969) 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; }