From patchwork Tue Jul 27 17:41:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 1510606 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Pajs+lVz; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (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 ozlabs.org (Postfix) with ESMTPS id 4GZ3zN4JCSz9sT6 for ; Wed, 28 Jul 2021 03:42:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 48CC4383941F for ; Tue, 27 Jul 2021 17:42:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48CC4383941F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1627407774; bh=XU7XZ6xIHY+i2kK5xByrp6QPZalkXTGjTipU5ZMd7m0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Pajs+lVz+N7H0jJ/MBh6nriJ3D8Vc4FoTTVpRdQPyZEZ0DJ2xtFVQJN2dL8AmzMm7 1A4NbBDheXUxP7LM4QmOh5TiGfypkUMtUE30ZlanMdVsR65Nm3s3nD/jiyNxpxxiHk qionhy2lxTetZeyXynxMxgke3FFgucJXZPtmp/98= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from cross.elm.relay.mailchannels.net (cross.elm.relay.mailchannels.net [23.83.212.46]) by sourceware.org (Postfix) with ESMTPS id F1DF9383D80A for ; Tue, 27 Jul 2021 17:41:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F1DF9383D80A 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 394911221C5; Tue, 27 Jul 2021 17:41:42 +0000 (UTC) Received: from pdx1-sub0-mail-a35.g.dreamhost.com (100-96-16-89.trex.outbound.svc.cluster.local [100.96.16.89]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9125A121FF9; Tue, 27 Jul 2021 17:41:41 +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.16.89 (trex/6.3.3); Tue, 27 Jul 2021 17:41:42 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Sponge-Trade: 026990352db75a39_1627407701835_78516611 X-MC-Loop-Signature: 1627407701835:1098371732 X-MC-Ingress-Time: 1627407701835 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 41F1986717; Tue, 27 Jul 2021 10:41:41 -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 24A3186716; Tue, 27 Jul 2021 10:41:37 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a35 To: libc-alpha@sourceware.org Subject: [PATCH 0/5] Static analysis fixes Date: Tue, 27 Jul 2021 23:11:24 +0530 Message-Id: <20210727174129.3612656-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3484.7 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_BL_SPAMCOP_NET, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_BL, RCVD_IN_MSPIKE_L3, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-Patchwork-Original-From: Siddhesh Poyarekar via Libc-alpha From: Siddhesh Poyarekar Reply-To: Siddhesh Poyarekar Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" These are some issues identified through static analysis. The gaiconf_init implementation is quite ugly and needs a refactor, but the patch 5/5 is a minimal fix to ensure that a double-free is avoided. Siddhesh Poyarekar (5): ldconfig: avoid leak on empty paths in config file gconv_parseconfdir: Fix memory leak iconv_charmap: Close output file when done copy_and_spawn_sgid: Avoid double calls to close() gaiconf_init: Avoid double-free in label and precedence lists elf/ldconfig.c | 6 +++++- iconv/gconv_parseconfdir.h | 9 ++++----- iconv/iconv_charmap.c | 2 ++ support/support_capture_subprocess.c | 1 + sysdeps/posix/getaddrinfo.c | 2 ++ 5 files changed, 14 insertions(+), 6 deletions(-)