From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by sourceware.org (Postfix) with ESMTPS id 38FA33858D28 for ; Tue, 11 Apr 2023 22:15:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 38FA33858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bounce.ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 0B1A020153; Wed, 12 Apr 2023 00:15:36 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y9iJ9SX2Hf_a; Wed, 12 Apr 2023 00:15:35 +0200 (CEST) Received: from begin (lfbn-bor-1-1163-184.w92-158.abo.wanadoo.fr [92.158.138.184]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id D587A20150; Wed, 12 Apr 2023 00:15:35 +0200 (CEST) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1pmMH1-001KWt-1O; Wed, 12 Apr 2023 00:15:35 +0200 From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault , commit-hurd@gnu.org Subject: [PATCH] aio: Fix freeing memory Date: Wed, 12 Apr 2023 00:15:33 +0200 Message-Id: <20230411221533.317235-1-samuel.thibault@ens-lyon.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. --- 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); -- 2.39.2