Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4453452ioo; Tue, 31 May 2022 05:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz96fkFTo94MWhDcBI6wjWQA74lCGvCWM4Ct/ugiuFmt9HVaJxZX/ESbJUKq1kDW5eOOFFs X-Received: by 2002:aa7:d285:0:b0:42d:ca4f:a046 with SMTP id w5-20020aa7d285000000b0042dca4fa046mr13804299edq.354.1653998486766; Tue, 31 May 2022 05:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653998486; cv=none; d=google.com; s=arc-20160816; b=hNjz2+doVsVHDTdtgz0Ymyh9ajYtojo3kppZKBKgjbyKfCT4iKE+rk6M6aEx5D0pfh EajZ7hAWKG+5XnaKjJL/EdMnBrYE+olFPpDCoPuBPV1G6btI1tQRbwIdwd9zte2ccFL0 bZx/KyrAPcTr/KzYs3T+SE9YhrBe4JUuZc6xhj6UGx/C2CJx8NNDMMOAxywstdluYu2i AAAUM9ofmRoo2SLop5cwUBLLAarAME0kMFsptAZf9fzlDT9+FwDdCCGUNI34bciud/Ra WqpOkorVbl6rtZugL0cpmdx2aQGQO+YftqLkBQz8e1pHyH+qnlPEUS0/+3p3+88TGZng KWSA== 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=w65JzII6Z/1YZg9BBYohRLSbbdJdkUnU+fmNKp6g4lU=; b=U4NvV8LYKAasnfr9wM5XPimyKO5PlEtFUH6bwT24MHCMgnu4rSdVODv9KGj5l4Cm5L dWGR4xTyKoDdEyxrTQu8S24SPSNfnFvkr14qwrxM4tbHg8yOcS9nzvEWggXW2kk+oALZ UBj/2vq8gyBQfxrnP/yrTEg9l4JMTQo57MXoEwq9ThMiRlH8/tQDBk4uBJdMf8AwUH2F OIDx0h4BsCvF/J0ZeHg0JmT7JO1lVaHw44kiRn+puh7IR1C5v+im/Gt0scnQkLSAuz3s vcIkRGu8w8UCO7L6oHLsxdklP/NTOZQn/NJyOpOhIK85/51S80Xs4VGoIvheUXcBOgq7 JaOg== 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 e17-20020a50d4d1000000b00418c2b5bdadsi12243658edj.143.2022.05.31.05.01.01; Tue, 31 May 2022 05:01:26 -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 S244582AbiEaHmG (ORCPT + 99 others); Tue, 31 May 2022 03:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240481AbiEaHmD (ORCPT ); Tue, 31 May 2022 03:42:03 -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 1949B17055 for ; Tue, 31 May 2022 00:41:49 -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-281-w-maGEfnNiSnBDBlYG4rww-1; Tue, 31 May 2022 03:41:47 -0400 X-MC-Unique: w-maGEfnNiSnBDBlYG4rww-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 A6CD1185A7A4; Tue, 31 May 2022 07:41:46 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65859140EBD5; Tue, 31 May 2022 07:41:43 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez V2 07/13] Fixing leaked_handle in l2cap-tester.c Date: Tue, 31 May 2022 13:11:11 +0530 Message-Id: <20220531074117.610321-8-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/l2cap-tester.c:1712: leaked_handle: Handle variable "new_sk" going out of scope leaks the handle. Signed-off-by: Gopal Tiwari --- tools/l2cap-tester.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c index d78b1e29c..3f0464013 100644 --- a/tools/l2cap-tester.c +++ b/tools/l2cap-tester.c @@ -1709,6 +1709,7 @@ static gboolean l2cap_listen_cb(GIOChannel *io, GIOCondition cond, if (!check_mtu(data, new_sk)) { tester_test_failed(); + close(new_sk); return FALSE; } -- 2.26.2