From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 498481F8C6 for ; Tue, 27 Jul 2021 17:46:43 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DA59383983E for ; Tue, 27 Jul 2021 17:46:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DA59383983E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627408002; bh=/jqxPjdEqyVmrLrDaH9YSPWaPuYd/dsAHT4ME17LyNo=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=CQQ3VRZOuoBrAktDdE+K+R4uigFYGNpSc5BJUlU+qK2XJqcQxmxBQPj1JDWNQm+9q sORDLClGcAPin1rVlcZFx2fRTPVeeoQwBRMgFIwLguObX6TBc5qUwFku1zdWll94Js osnv0EF8xzOFu+egiSZ937QVJrrrHSgPpwH4YCKQ= Received: from dragonfly.birch.relay.mailchannels.net (dragonfly.birch.relay.mailchannels.net [23.83.209.51]) by sourceware.org (Postfix) with ESMTPS id 9658A3839417 for ; Tue, 27 Jul 2021 17:42:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9658A3839417 X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 847EE121E5D; Tue, 27 Jul 2021 17:41:59 +0000 (UTC) Received: from pdx1-sub0-mail-a35.g.dreamhost.com (100-96-11-33.trex.outbound.svc.cluster.local [100.96.11.33]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 23A98121C99; Tue, 27 Jul 2021 17:41:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a35.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.11.33 (trex/6.3.3); Tue, 27 Jul 2021 17:41:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Left-Versed: 4fd02f4e61172fb6_1627407719374_1857131315 X-MC-Loop-Signature: 1627407719374:49639539 X-MC-Ingress-Time: 1627407719373 Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id C250186717; Tue, 27 Jul 2021 10:41:58 -0700 (PDT) Received: from rhbox.redhat.com (unknown [1.186.101.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: siddhesh@gotplt.org) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTPSA id E3B3386716; Tue, 27 Jul 2021 10:41:55 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a35 To: libc-alpha@sourceware.org Subject: [PATCH 5/5] gaiconf_init: Avoid double-free in label and precedence lists Date: Tue, 27 Jul 2021 23:11:29 +0530 Message-Id: <20210727174129.3612656-6-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210727174129.3612656-1-siddhesh@sourceware.org> References: <20210727174129.3612656-1-siddhesh@sourceware.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Siddhesh Poyarekar via Libc-alpha Reply-To: Siddhesh Poyarekar Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" labellist and precedencelist could get freed a second time if there are allocation failures, so set them to NULL to avoid a double-free. --- sysdeps/posix/getaddrinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index 838a68f022..43dfc6739e 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -2008,6 +2008,7 @@ gaiconf_init (void) l =3D l->next; } free_prefixlist (labellist); + labellist =3D NULL; =20 /* Sort the entries so that the most specific ones are at the beginning. */ @@ -2046,6 +2047,7 @@ gaiconf_init (void) l =3D l->next; } free_prefixlist (precedencelist); + precedencelist =3D NULL; =20 /* Sort the entries so that the most specific ones are at the beginning. */ --=20 2.31.1