Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5517819ioo; Wed, 1 Jun 2022 07:11:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0rdmIO1T1/jyx9rzlobB697Jug5NlS5EnKj5+KLUkfrp+2931T0hUUyGBWZnqd4sWpkJd X-Received: by 2002:a05:6a00:1890:b0:51b:a981:637a with SMTP id x16-20020a056a00189000b0051ba981637amr62084pfh.49.1654092684819; Wed, 01 Jun 2022 07:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654092684; cv=none; d=google.com; s=arc-20160816; b=CKW3TlwSQhjbZZ1O+C6zcOPx07iLgBUQeJo+2ntIb59N86KGU7nmJGrHdSTYWvdHOo RI3CvmEa4NNOQbrudlZEXXbqf/0aKzin79nrIyTf8iVDXCH/8dHhyk75emx8OQWmNN6L ir7vZ2EA4PE956cbr3touv8+ezFTyxFuz2SH1CyDkls5oixZ8A7OhwI5eiBapTaZa9dF JQ2tfZ0nhNpGISN1JFW6fZeezNUNaeXclMNuzO9n6hwb6Cz0wmu25wimKSPzXg4RUDuV 2wOc7QDz8UYKV7d9s/GG7KqQ7mX0v4E1KaSosNqOuR9f5/PpmksGMCMxNhLKmKHq9XoL j4lQ== 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=tRCTN1DyRt/FkUsRSJBLOfmbmQISaEUTXs/ityq7bPQ=; b=ViprqEwBJD578HZWMvCsDcR5e1iLIHPlSpJqBcbDOddlfBECKFBhdjw0P3VLrV+Ej5 64KtgbB+0bT66jcj6BiRISsjODaBCPAc6yPWZupfrhlgNI592JUq3QmET2HHsoio//fK WGpcK9CnYCY+iHf2VWlwPZOlI9Sp6ixlxT7XDFU1rKeI4wRHXmobP/GhyES9vGWehOcZ 3t3MQoJpPGVcJfpbi6TOSoOD7MDO6BA8V/ikSsH1YcCVuvhn59QOqQ9v6MF7gIiqggUt vaK+5xiAhz5+AoI+b5BTKQQJqK8szL3eUglPqevorz3z8b7uOJdrXT2tcQLrryhqlxyf X9Dw== 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 l7-20020a17090270c700b00153b2d16543si2366217plt.331.2022.06.01.07.10.58; Wed, 01 Jun 2022 07:11:24 -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 S244576AbiEaHmJ (ORCPT + 99 others); Tue, 31 May 2022 03:42:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244587AbiEaHmD (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 2D996140D7 for ; Tue, 31 May 2022 00:41:57 -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-605-RKOck1zFMSCF8Af9P1sbJg-1; Tue, 31 May 2022 03:41:53 -0400 X-MC-Unique: RKOck1zFMSCF8Af9P1sbJg-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 2091918F0269; Tue, 31 May 2022 07:41:53 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.153]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6DC71410F37; Tue, 31 May 2022 07:41:50 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez V2 09/13] Fixing leaked_handle in obex-client-tool.c Date: Tue, 31 May 2022 13:11:13 +0530 Message-Id: <20220531074117.610321-10-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/obex-client-tool.c:315: leaked_handle: Handle variable "sk" going out of scope leaks the handle. Signed-off-by: Gopal Tiwari --- tools/obex-client-tool.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/obex-client-tool.c b/tools/obex-client-tool.c index ab9332896..cb0e41247 100644 --- a/tools/obex-client-tool.c +++ b/tools/obex-client-tool.c @@ -312,6 +312,7 @@ static GIOChannel *unix_connect(GObexTransportType transport) if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) { err = errno; g_printerr("connect: %s (%d)\n", strerror(err), err); + close(sk); return NULL; } -- 2.26.2