Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4853462ioo; Tue, 31 May 2022 13:15:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq3J/XntxZt4mHuB92z2x5Lyi1I7AB6enCKU0YDq+mnwatV14GBntdzKJZakw9x4XMySvR X-Received: by 2002:a17:907:1629:b0:6fe:bfe2:5289 with SMTP id hb41-20020a170907162900b006febfe25289mr45059101ejc.723.1654028157618; Tue, 31 May 2022 13:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654028157; cv=none; d=google.com; s=arc-20160816; b=IGX8mjmWDxTWjnQylNMIWmYfvRnVZN7yxuPYLBWZlrXbZkBPPFFrVppNMdp8/YJsBg d3Vdyi3+hgC6rVDeau6oA/U4UXYbcr8tfpng4Tm5sKg6zhuM04+yG9GInAqDbI4ga1ve KagngEHJ4xXmtlNCSb2GUwJUF1DZqiLYbIh6qHLhoSoe3eHjwahRowSvlFTzAs0pFBjl YdZ8FISNNeqHXWiFG2STZFDKW9iVAOCet1NFW7+FRsB+BTrJe1xk7mmtk/vandSCEmhD yvzjP0BKGnj0Y2qd0po+9PD+AxZVaKxkgQEvsUInGFeOpoXA+p2Rv/GWNAYoPDkVXT3d zzkA== 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=CtoFKJQw7Ux9nkml05ew1lQhdgzV7qQ5ZVdLGq6gwjw=; b=Yow4iQn6E6Tv6rRnqXeixk7Qm5aKpVCCSXBKeLYytEc/9geBaCfPsdvmxTLnzV1Nf9 sbfcr8esc5o/55yJdE5fD8MvJUnHQKf4RTwgLJkk8BGDFaqRvAVD/NRYKArjf7FOcObt UJ2De+SzlLDCpmwP4VZwGP8UVwLZ/LvNQKl4tYJK5FErwDsDMtSvesZFGHVVpL8j5xIC 5x7C3nmzxvN+UkYEh5Gi+WPC9OGM22feDg5Y3aXzfAS6RVi5ZXXfzM3Q9UQdrE9VNHVG 1ZKuQe5LA6vxLsGYLBZdfmru0Pk1WqApeBrA/ERZV85eeBt5M2fiTLvu9+M6kgzUCJWX 4a7w== 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 du13-20020a17090772cd00b006effe0b6fdcsi1031650ejc.613.2022.05.31.13.15.14; Tue, 31 May 2022 13:15:57 -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 S244559AbiEaHmE (ORCPT + 99 others); Tue, 31 May 2022 03:42:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244563AbiEaHmB (ORCPT ); Tue, 31 May 2022 03:42:01 -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 B8C6C140C1 for ; Tue, 31 May 2022 00:41:45 -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-619-faiczsxNPkSRCy644BqX9g-1; Tue, 31 May 2022 03:41:40 -0400 X-MC-Unique: faiczsxNPkSRCy644BqX9g-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 6F40C803B22; Tue, 31 May 2022 07:41:40 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 439631410F36; Tue, 31 May 2022 07:41:37 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez V2 05/13] Fixing leaked_handle in cltest.c Date: Tue, 31 May 2022 13:11:09 +0530 Message-Id: <20220531074117.610321-6-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 While performing static tool analysis using coverity found following reports for resouse leak bluez-5.64/tools/cltest.c:75: leaked_handle: Handle variable "fd" going out of scope leaks the handle. Signed-off-by: Gopal Tiwari --- tools/cltest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/cltest.c b/tools/cltest.c index 2766fcd23..250c93cc7 100644 --- a/tools/cltest.c +++ b/tools/cltest.c @@ -72,6 +72,7 @@ static bool send_message(const bdaddr_t *src, const bdaddr_t *dst, return false; } + close(fd); return true; } -- 2.26.2