Message ID | ZH/kzy91Kw/7oe/D@squeak.grove.modra.org |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3791520vqr; Tue, 6 Jun 2023 19:01:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6GjHDQwuSoRV5VSLo3SJ/iDcTwJQ2lCZIPlRjMse/xAhJikxM9QQpEMh5Pnxlyen01+qmG X-Received: by 2002:a17:907:3f9a:b0:96f:8666:5fc4 with SMTP id hr26-20020a1709073f9a00b0096f86665fc4mr5225427ejc.50.1686103263503; Tue, 06 Jun 2023 19:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686103263; cv=none; d=google.com; s=arc-20160816; b=CNc/dFME9nJFOCyXTTJoOCZipQY8EIzL5CCDAVz6RRliPkpYvOUHmVdNfTUMzuV2bH r+zKA/OUqvOXytuS3RAAnACWSXL0Z8qHFeVml+PCSLoEf04USRMFum/tKl4VuVMrh+G9 bixFBS3/A56mrjMB5K/fmaoWmm6cNqk5/OA+F3lzmAJxHXymi4U+L9nLOEg99Yj+H7ay TTO2DrMJPTiPGR3YMtOei99GZgwR3tlrEbh+ULDGxlw5FQWsOiuj9CjIfibHat9k0zej ZbVU4cE0OvA24Rk+k9TbKqopUBR2RtAQuYgo0z9zJUWaNYYMojj+PuhW4MUlSVQzYY0s sYFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=pddsysVikLlOGPmBkkbYLAO1SI9OOpNYMCJK5SfdZjw=; b=akY3kyQ+5xdffK1nS3sR0Zra5yGPlpxrKgFb4tjYQtnhlfnG/9CCJGtMgfgW/4DtBl o1g9C+vldqsSrjXpXCFBc9nA3Llam5gyuQmfO1Cd5Q1A9mXFOvuuufsoRUxtPMX4IcYQ K9aOE8/CXgy0fYbcSxNpVg6ydoIaWBUtadKHKw0JXuz49Ss0/u4Em+X6AnHGbAnd3k78 ipQmRTFr7KtmYZiTITW0aYirlobSwXnpzQDkEETejGw0W0lp6xCS4xYyFxPL2PiG3T9b gL4rnQ/Sa8AC5E6DJLzUFQMbKphb4doBKKquhhTPpwe83SZ/JS++0EWdNPKB12hca0Ji if2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hV0JQ0iI; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id nb17-20020a1709071c9100b009780cfaae1bsi3385443ejc.32.2023.06.06.19.01.03 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 19:01:03 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=hV0JQ0iI; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CFA1C38582B7 for <ouuuleilei@gmail.com>; Wed, 7 Jun 2023 02:01:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CFA1C38582B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1686103261; bh=pddsysVikLlOGPmBkkbYLAO1SI9OOpNYMCJK5SfdZjw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hV0JQ0iIx+RViquhWXC9bf+AtmfGWSrpcUYSqchIeGD+cab+9ZNE3We17H50NMSrw wpFxEIar/Q6g6UbxZBx3EzEDAGAq4oRIGau19cJT4NnAErDdJiY2IUwyrgmwAY8Ppr LA+fWUXdvNam3d8YkOrZ6XP1erYxpJ5I/3QgdcpY= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 678893858025 for <binutils@sourceware.org>; Wed, 7 Jun 2023 02:00:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 678893858025 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-6b1576c2f6eso3185549a34.3 for <binutils@sourceware.org>; Tue, 06 Jun 2023 19:00:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686103250; x=1688695250; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pddsysVikLlOGPmBkkbYLAO1SI9OOpNYMCJK5SfdZjw=; b=lPsYPaADnqLYXT5KxmSZbiZHoHOUF6vP/Ad5tfkvivQC1S4LQFGNpN1ytDs1CzaaUB DvRkUplgW+pYR5qpKS/vV1x1hVOSU3yKEK7Qk35NMD4WMW6EEPM+9sQr0LRwhDt7AQ8C R8o0DeyTqTFJEj7kyPqZqGTJcnRCTFq8H24g10MTDWyirc3+zKD0JpcYfZxT7oNXoKrB 2q1/Fb2LIdrLVXLFi6vBq3Ce0qaeLgPO5rrEEnx+Eq24DxEOK/B3j7vZKfYOulpDs59K oXLkTlpmxdHw70YJAQljjP5VcjC9kl+H6lCTMxYkxiRw690iyCzUBMQUH8EfijiXozXV GZHQ== X-Gm-Message-State: AC+VfDzY/CwKByIFv8XHjd09qx/8qi99Nzbr/8HLelPPJihvZHwP5/L0 guzD7FOeNNKUsHHd1IslOc4K3e6AcSk= X-Received: by 2002:a05:6358:cc22:b0:129:df95:f9a9 with SMTP id gx34-20020a056358cc2200b00129df95f9a9mr2000963rwb.2.1686103250081; Tue, 06 Jun 2023 19:00:50 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:1c89:1f1d:dc02:be76]) by smtp.gmail.com with ESMTPSA id bs191-20020a6328c8000000b0053491d92b65sm8077541pgb.84.2023.06.06.19.00.49 for <binutils@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 19:00:49 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 08EB51142C8A; Wed, 7 Jun 2023 11:30:47 +0930 (ACST) Date: Wed, 7 Jun 2023 11:30:47 +0930 To: binutils@sourceware.org Subject: bfd/elf.c strtab memory leak Message-ID: <ZH/kzy91Kw/7oe/D@squeak.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3034.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> From: Alan Modra via Binutils <binutils@sourceware.org> Reply-To: Alan Modra <amodra@gmail.com> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768007415798828448?= X-GMAIL-MSGID: =?utf-8?q?1768007415798828448?= |
Series |
bfd/elf.c strtab memory leak
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Alan Modra
June 7, 2023, 2 a.m. UTC
* elf.c (_bfd_elf_compute_section_file_positions): Free strtab on set_group_contents failure return path.
diff --git a/bfd/elf.c b/bfd/elf.c index 81eb3ef71fa..af2fb04dcbe 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -4254,7 +4254,11 @@ _bfd_elf_compute_section_file_positions (bfd *abfd, { bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed); if (failed) - return false; + { + if (need_symtab) + _bfd_elf_strtab_free (strtab); + return false; + } } shstrtab_hdr = &elf_tdata (abfd)->shstrtab_hdr;