Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3547988ioo; Mon, 30 May 2022 04:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHiSR0CAJmaWG2bZGVY3C0D++iH5nxUdU056m5wHMdQbWH65Mryg1rcMmME43CYZfSa4u+ X-Received: by 2002:a17:906:99c1:b0:6fe:b01d:134 with SMTP id s1-20020a17090699c100b006feb01d0134mr42554619ejn.598.1653911098394; Mon, 30 May 2022 04:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653911098; cv=none; d=google.com; s=arc-20160816; b=Tur15uqdujEJSuDDOo9VshTnDB8HmynNaMKVJS2rdpVpzqOiHJItBeUU8ZACyJH3cN ENNhl2foWQMhYEx+gbcE2c3naXgyFcIvR7GBDSSn609krQdhiRjpjY1FCSDJApVhbpPo O36Vo6kM2JQZT9UV2OwDrEqytxtfuakrOZWf4IuE0ZJG2s0lENO1IIu1E4Ec9cCxvgRu 0Uj/J+ueIGQyJlagzq6yRTmVkXJKvh2c0hZw8iiM/xS0nOYwmkZZ2aAKU1lzdlWY6OXa sNpgnif+pcB0s3BBeuKpLwnGpwSe3GDbq+Z6go2ZVq8nD0FA1GflOzMgMnwgzLSSlgVL LqSg== 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=NRSV/LTyn0Vmd26/0jb4abjD1TqysUZp0WTR8GbSfV4=; b=t7ihnnekTkiWS83VQ6VIaMGeqPtfwWNMV3yohbkD/iAI3M0TLcoYKJJcO+czrubDGj l53eYZtadI4nEn0Exg50scTEPXzQmqlixTx84bmEDylPGCLbg/Yww+spj6UJ43h0rDyj bkSOPvL0mO/neD/SPbeO5JvSWotq0m2saadT8TYhVeaxIKIjyQjQMgzMdP/zGkPbQBaR et5x7bMV+1DjwaDIC1/F/bt9akIxIFjQXT23WkG2pmkBq3cwuLKt93DVgw4N/HR2DGEB BZgUwfWwHu5dr96kdreNgU70VG0BiVTdcbSz0ZAtqURRVwk3c4f1DbRXVrfApSH7sxFU Dx0g== 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 z22-20020a056402275600b0042b75459774si13379955edd.310.2022.05.30.04.44.32; Mon, 30 May 2022 04:44: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 S233179AbiE3IMk (ORCPT + 99 others); Mon, 30 May 2022 04:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233218AbiE3IMi (ORCPT ); Mon, 30 May 2022 04:12:38 -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 0191337A9C for ; Mon, 30 May 2022 01:12:36 -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-495-ZShMphXOMWW-YS1vpymWEA-1; Mon, 30 May 2022 04:12:33 -0400 X-MC-Unique: ZShMphXOMWW-YS1vpymWEA-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 A11953C02183; Mon, 30 May 2022 08:12:32 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3ACD31410DDB; Mon, 30 May 2022 08:12:29 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez 05/13] Fixing leaked_handle in cltest.c Date: Mon, 30 May 2022 13:42:01 +0530 Message-Id: <20220530081209.560465-6-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 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