Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5102197ioo; Tue, 31 May 2022 20:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIVHPTBZOyNquPwT1/NWIH42QG3kgJ5YqgdAEyw2Trxnl4k13ihDeBB6U+8IpgCwZsuwxC X-Received: by 2002:a17:903:41c1:b0:161:d0d8:d1c7 with SMTP id u1-20020a17090341c100b00161d0d8d1c7mr64791269ple.148.1654053824269; Tue, 31 May 2022 20:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654053824; cv=none; d=google.com; s=arc-20160816; b=YdYXT3XyLTE6Ml/+RzRtTH+djCIGxis+w7OIYca5c9VtpLL5L+JL/pLpHu5Z8K1LM3 DQTUciVZj+o/97BhypMxv6fdnHjqnlsxo2GrqpwwkknYSaJ4fkF8vZM83S7bszPH0CFQ y+E46LXSclk7wS4Jc4breZi7gYIkqHGgVYgnz4rJKuZOs0O5H7JpdWzXcxcRZsMJWPo1 ZwddQGQq7Stq2cBoxsZxys4bGud/M39iwWN5mgnYp2/4n3A0n4SJ+0hCA2LE1sRjX4oS pFy9MP9+Oksi6/pYaAOvm9uBA7CJ7CqGaFWK6hGJiWFkwvAV4eEgF2vMy5+vRpK4AExR yhxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=C7KN6R0XMWo6ZSPt+TQgsdl6+t8Pe47h64JwBvlCVXA=; b=fJS/tt6aVv4XjTcopwTi5NWcDp2rZ8in5An1mhtMCEorauqWe8oJgApt7SXNNhdLcg D/9CaUHfbNazzk6ACDINOJ8L4pOEuLmVUtDo79Jn95UHlEto5Tks8E5Zhlwv0GJp3YR+ kmMQafdK6diewirfsW1QvlMcEFB5vNI+49ByBDqYs/W5oMCKlGA7hRa/A+vpZQh11LCx Z/2/mGlPnH1JpSX3Sy+stBbdGHpcp/sZJyW4uMpQwk3uRwNwEMfElw4hIP9L2iyMvC9Y zWygmMkC10jm4TQhvW6+SBRsCL4KQVPcY5aiGSK07MUkSHRnTlJNEn3+5tbxqf7SaNA/ 4qrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv3-20020a17090b1b4300b001d97a68ce61si5448184pjb.172.2022.05.31.20.23.29; Tue, 31 May 2022 20:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244577AbiEaHmR (ORCPT + 99 others); Tue, 31 May 2022 03:42:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244563AbiEaHmI (ORCPT ); Tue, 31 May 2022 03:42:08 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [205.139.111.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C37B1A1A1 for ; Tue, 31 May 2022 00:42:07 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-510-vheDCN5XMACcpq9-KRT4Bg-1; Tue, 31 May 2022 03:42:03 -0400 X-MC-Unique: vheDCN5XMACcpq9-KRT4Bg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32F28101A54E; Tue, 31 May 2022 07:42:03 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 032ED1410DDB; Tue, 31 May 2022 07:42:00 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez V2 12/13] Fixing possible use_after_free in meshctl.c Date: Tue, 31 May 2022 13:11:16 +0530 Message-Id: <20220531074117.610321-13-gopalkrishna.tiwari@gmail.com> In-Reply-To: <20220531074117.610321-1-gopalkrishna.tiwari@gmail.com> References: <20220531074117.610321-1-gopalkrishna.tiwari@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Gopal Tiwari Reported by coverity tool as follows : bluez-5.64/tools/meshctl.c:1968: freed_arg: "g_free" frees "mesh_dir". bluez-5.64/tools/meshctl.c:2018: double_free: Calling "g_free" frees pointer "mesh_dir" which has already been freed. Signed-off-by: Gopal Tiwari --- tools/meshctl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/meshctl.c b/tools/meshctl.c index 18e20c40d..38ffd35f3 100644 --- a/tools/meshctl.c +++ b/tools/meshctl.c @@ -2015,7 +2015,6 @@ int main(int argc, char *argv[]) fail: bt_shell_cleanup(); - g_free(mesh_dir); return EXIT_FAILURE; } -- 2.26.2