From patchwork Tue May 11 12:28:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Siddhesh Poyarekar X-Patchwork-Id: 1477113 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@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=ShVRUewh; dkim-atps=neutral Received: from sourceware.org (server2.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 4Ffcdz4LNTz9sWQ for ; Tue, 11 May 2021 22:28:23 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EE3DF3886C68; Tue, 11 May 2021 12:28:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE3DF3886C68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620736101; bh=oLgr5/S58RTKNuCkiTSqsbwYKLOd7X9VNwtCc0P7mL0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ShVRUewhEU53wfBbogd7mAeUpXX8pucqQBjZ1M4uBZODANKdjGbu4I3XXfnNfF7+W Q/vNS08DG4cgpvRc7oSQlU660ABTlcke69m7148sq0zRmgVqDBrOcR+kYsSaFbNyw2 GwwNYdfaD80s+IiEzylj7MDVDrfY4taSNyoBIafI= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from insect.birch.relay.mailchannels.net (insect.birch.relay.mailchannels.net [23.83.209.93]) by sourceware.org (Postfix) with ESMTPS id 9F2FA3839C41 for ; Tue, 11 May 2021 12:28:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9F2FA3839C41 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 106F24826AB for ; Tue, 11 May 2021 12:28:16 +0000 (UTC) Received: from pdx1-sub0-mail-a29.g.dreamhost.com (100-96-13-83.trex.outbound.svc.cluster.local [100.96.13.83]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id A9F5F4833C2 for ; Tue, 11 May 2021 12:28:15 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|siddhesh@gotplt.org Received: from pdx1-sub0-mail-a29.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.13.83 (trex/6.2.1); Tue, 11 May 2021 12:28:16 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|siddhesh@gotplt.org X-MailChannels-Auth-Id: dreamhost X-Towering-Reaction: 3509ed0844af22f6_1620736095905_3559282901 X-MC-Loop-Signature: 1620736095905:2287916875 X-MC-Ingress-Time: 1620736095905 Received: from pdx1-sub0-mail-a29.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a29.g.dreamhost.com (Postfix) with ESMTP id 706FA7EDB6 for ; Tue, 11 May 2021 05:28:15 -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-a29.g.dreamhost.com (Postfix) with ESMTPSA id 728737E49E for ; Tue, 11 May 2021 05:28:13 -0700 (PDT) X-DH-BACKEND: pdx1-sub0-mail-a29 To: libc-alpha@sourceware.org Subject: [COMMITTED] write_archive_locales: Fix memory leak Date: Tue, 11 May 2021 17:58:02 +0530 Message-Id: <20210511122802.286782-1-siddhesh@sourceware.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-3494.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@sourceware.org Sender: "Libc-alpha" Fix memory leak identified by coverity. --- locale/programs/locale.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/locale/programs/locale.c b/locale/programs/locale.c index 575b208e82..ca0a95be99 100644 --- a/locale/programs/locale.c +++ b/locale/programs/locale.c @@ -713,6 +713,8 @@ write_archive_locales (void **all_datap, char *linebuf) locrec->record[LC_CTYPE].len); } + free (names); + ret = used; }