From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id E59AD3858D32; Wed, 12 Apr 2023 18:05:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E59AD3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681322759; bh=ufz+zm+/CTrpCcRASEC3NmFGn2aP4HmfnCZgiApU27A=; h=From:To:Subject:Date:From; b=HBpXgXS4UsuvlsW1s42hksNAt6m5wNEfCVzguUz8mXnOlddj9V9Yigs/fRSqlu8O3 FDHmRxqZDRq6q6ImBPzLXRJzRKcKLL7xsD4Vm07lpakCS0JC533o/UNV9N/lvHh7p2 maj9CvHmkAE3jZmwtcaxAv7iqYp3064rdvyRCc9w= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] aio: Fix freeing memory X-Act-Checkin: glibc X-Git-Author: Samuel Thibault X-Git-Refname: refs/heads/master X-Git-Oldrev: 5473a1747a7bd10a7a271c7e01e942711a707bb8 X-Git-Newrev: 0cee4aa92f5b9b213856c8ba1ab84c34d73c943b Message-Id: <20230412180559.E59AD3858D32@sourceware.org> Date: Wed, 12 Apr 2023 18:05:59 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0cee4aa92f5b9b213856c8ba1ab84c34d73c943b commit 0cee4aa92f5b9b213856c8ba1ab84c34d73c943b Author: Samuel Thibault Date: Wed Apr 12 00:12:02 2023 +0200 aio: Fix freeing memory The content of the pool array is initialized only until pool_size, pointers between pool_size and pool_max_size were not initialized by the realloc call in get_elem so they should not be freed. This fixes aio tests crashing at their termination on GNU/Hurd. Diff: --- rt/aio_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rt/aio_misc.c b/rt/aio_misc.c index 49ec0aa293..4b850b1ab6 100644 --- a/rt/aio_misc.c +++ b/rt/aio_misc.c @@ -702,7 +702,7 @@ __aio_freemem (void) { size_t row; - for (row = 0; row < pool_max_size; ++row) + for (row = 0; row < pool_size; ++row) free (pool[row]); free (pool);