Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3546142ioo; Mon, 30 May 2022 04:41:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJOvDgc7pUreqcCgcK77DVUOnTCeClWXeXQD02/02t6L0GE8jDqCn21Q38BxErqLaST0so X-Received: by 2002:a17:907:7f19:b0:6fe:ce26:8f0d with SMTP id qf25-20020a1709077f1900b006fece268f0dmr33607107ejc.27.1653910918741; Mon, 30 May 2022 04:41:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653910918; cv=none; d=google.com; s=arc-20160816; b=G1IWromy+hnBRQkTPLVoWhSCb6OwL7VS0rM5CA9qmGAhPQIZM30HDsh88PjONQoPIb YZXGBdJDKrOHcyHmPgW14KvsDbIteOsLMBdnEdzcJgwpBdAr/x7+YMeqVffHIeDH9EJH uPqBRdGKlCVF4FfzP8xpwzEyq1OopaXcC5+EWOLq6Z0t/rgsSn5lDQLzlEf9vYFrMbUD fW7Dc5MwM7ZSoRq9+MtOjB9V37XY3kUdyDiWyJU2n5FZxzt2E4VDNCZqAuf3WN/fv4br rwJEMuFYaaWay0AzfceaFUtn0HnPyMJWxmHDRZ7JtSYgI3uYbU492SniAHcRlZIXpRfG kQWw== 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=bNaY8NpnQHXC4UBLwALyPFmM9zqLJ32/0P9jgNzsTLQ=; b=G/rFzfUnzEr9Rsi1ZELzD6czb3w37S+u83VrrP2ehx76SjMXIPuDx0CqnvQxscBvoZ ltamncJ5/1IYUTn1vuoFR35kNoP0ObfUSABkGnqR1/oOzHZ+E+8e3P3Y9rk/iPFTFWBz 6LDlDhqfuyhiBo3eAfwD0eznBe+beN15Tcrbx90UGZGEp7hv9rwMorsqv5lrxkDuZXi5 gmXYPkNTAbsaukN7IEtutKnfXKloR8ijD8cglvHF+cgu0dCCB9JTyV20n/HFE18fgWFM GlUn5++HZR6xtoz6lVSCS3Z8zNMNPJ7sEl3Jqi/JpXPQIw83KCchT8AArdQ+8VXIMHgl bRHQ== 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 js17-20020a17090797d100b006f385c98ca8si10349770ejc.615.2022.05.30.04.41.11; Mon, 30 May 2022 04:41:58 -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 S233225AbiE3INB (ORCPT + 99 others); Mon, 30 May 2022 04:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233341AbiE3INA (ORCPT ); Mon, 30 May 2022 04:13:00 -0400 Received: from us-smtp-delivery-44.mimecast.com (us-smtp-delivery-44.mimecast.com [207.211.30.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 217AB37017 for ; Mon, 30 May 2022 01:12:58 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-9DxRYK9bOJSSAFICN6qNxA-1; Mon, 30 May 2022 04:12:55 -0400 X-MC-Unique: 9DxRYK9bOJSSAFICN6qNxA-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 D7CEB29ABA25; Mon, 30 May 2022 08:12:54 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 30DE91410F36; Mon, 30 May 2022 08:12:51 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez 12/13] Fixing possible use_after_free in meshctl.c Date: Mon, 30 May 2022 13:42:08 +0530 Message-Id: <20220530081209.560465-13-gopalkrishna.tiwari@gmail.com> In-Reply-To: <20220530081209.560465-1-gopalkrishna.tiwari@gmail.com> References: <20220530081209.560465-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