Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3631443ioo; Mon, 30 May 2022 06:26:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgXZRBed+xHKIpLsYBAkTcZwgoHLcBGTfB7H0jkcH9bwx+ePZgi5VhB9sWjTZFkINM0zPG X-Received: by 2002:a17:907:9714:b0:6ff:338f:b4d7 with SMTP id jg20-20020a170907971400b006ff338fb4d7mr14744238ejc.718.1653917177515; Mon, 30 May 2022 06:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653917177; cv=none; d=google.com; s=arc-20160816; b=TwxxjyCe9B0fakx/f+bUM1IE9h9SsQ0OzNlqHljbqbhMLPMIkjraHAQ37q5uZUixmy NZwLBZ2M/AbmUezrOgXkgX3KKxaDxPLnAcZX6XOgHmYL0s+NZ+eK6z7BVVBI1dqJussp LJXiEotQz4xnFWXXAxXcL7+DFvA8FbuxkfABMz4txWz69BRkyydsBJ3zgakEe+kutuKr J4WCDwWZlpeXjvofKS5uppXpFtGQQUxqnHbMAmHX2UxajUXvgOve6nPWXyQ0WVBMVp+d cl5o/EClrnuVUgk8fegeWpsq3JiijcpqzXJVGH/YMFGCkXGbf/YsqQ3RFLp0lkhWjeSL Cacw== 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=CXYOhD/dJ+wP+vQ4j5mt/UotrRXFM54sQGR2VXElW4U=; b=aokglGsSa2T+kmCu0VcUSioP3vQ2uWKiXmRiK1T6SPXGxsYC3w4aZ4N04KSWe7oY3p JBCV2BmjJcdg3LVI2Ox8memFOOT9ntc005vKBeFsbuOqw3+NBgRdfFr4WXQlDxj8bm1B rdPQJjGAUgm30o13Q/iugruqxghPpPMCuT6a6+McHWUwj3MrD4LK4Ra8JwA83ppwRv/A AbOnQHjTf/EYStsL23pjeXjcO6kK2FtcEfYmjXKbHfda1BBo2PM1c/M2T6TUYe1ozAQR 3mINJGlPYHQXM+Eh1kCqODcwg0JZPph/HbzF6GbRhSBb55mDHhcWCTir7QC1QcRWqTY6 krGw== 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 gn16-20020a1709070d1000b006e88d2e4fe2si11213908ejc.967.2022.05.30.06.25.35; Mon, 30 May 2022 06:26:17 -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 S233285AbiE3INA (ORCPT + 99 others); Mon, 30 May 2022 04:13:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233328AbiE3IMt (ORCPT ); Mon, 30 May 2022 04:12:49 -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 B91D1762A8 for ; Mon, 30 May 2022 01:12:48 -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-urJmNI8RNKu4Wl1AodO3GQ-1; Mon, 30 May 2022 04:12:45 -0400 X-MC-Unique: urJmNI8RNKu4Wl1AodO3GQ-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 0B4518219B2; Mon, 30 May 2022 08:12:45 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.64.242.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7120140EBD5; Mon, 30 May 2022 08:12:42 +0000 (UTC) From: Gopal Tiwari To: linux-bluetooth@vger.kernel.org Cc: luiz.dentz@gmail.com, gtiwari@redhat.com Subject: [Bluez 09/13] Fixing leaked_handle in obex-client-tool.c Date: Mon, 30 May 2022 13:42:05 +0530 Message-Id: <20220530081209.560465-10-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/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