Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CD63C200B74 for ; Thu, 1 Sep 2016 17:20:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id CBE14160AB5; Thu, 1 Sep 2016 15:20:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1ED91160AA8 for ; Thu, 1 Sep 2016 17:20:24 +0200 (CEST) Received: (qmail 95519 invoked by uid 500); 1 Sep 2016 15:20:24 -0000 Mailing-List: contact dev-help@knox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@knox.apache.org Delivered-To: mailing list dev@knox.apache.org Received: (qmail 95504 invoked by uid 99); 1 Sep 2016 15:20:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2016 15:20:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D8304C2DDD for ; Thu, 1 Sep 2016 15:20:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Level: X-Spam-Status: No, score=-3.739 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.519] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id VicNehWOcjnF for ; Thu, 1 Sep 2016 15:20:23 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 7B86D5FBB4 for ; Thu, 1 Sep 2016 15:20:22 +0000 (UTC) Received: (qmail 95185 invoked by uid 99); 1 Sep 2016 15:20:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Sep 2016 15:20:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6A1522C1B7F for ; Thu, 1 Sep 2016 15:20:21 +0000 (UTC) Date: Thu, 1 Sep 2016 15:20:21 +0000 (UTC) From: "Larry McCay (JIRA)" To: dev@knox.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KNOX-748) Fix Resource Leak in X509CertificateUtil.writeCertificateToJKS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 01 Sep 2016 15:20:26 -0000 Larry McCay created KNOX-748: -------------------------------- Summary: Fix Resource Leak in X509CertificateUtil.writeCertificateToJKS Key: KNOX-748 URL: https://issues.apache.org/jira/browse/KNOX-748 Project: Apache Knox Issue Type: Bug Components: Server Reporter: Larry McCay Fix For: 0.10.0 New defect(s) Reported-by: Coverity Scan Showing 1 of 1 defect(s) ** CID 1361992: Exceptional resource leaks (RESOURCE_LEAK) /gateway-spi/src/main/java/org/apache/hadoop/gateway/services/security/impl/X509CertificateUtil.java: 299 in org.apache.hadoop.gateway.services.security.impl.X509CertificateUtil.writeCertificateToJKS(java.security.cert.Certificate, java.io.File)() ________________________________________________________________________________________________________ *** CID 1361992: Exceptional resource leaks (RESOURCE_LEAK) /gateway-spi/src/main/java/org/apache/hadoop/gateway/services/security/impl/X509CertificateUtil.java: 299 in org.apache.hadoop.gateway.services.security.impl.X509CertificateUtil.writeCertificateToJKS(java.security.cert.Certificate, java.io.File)() 293 294 char[] password = "changeme".toCharArray(); 295 ks.load(null, password); 296 ks.setCertificateEntry("gateway-identity", cert); 297 298 FileOutputStream fos = new FileOutputStream(file); CID 1361992: Exceptional resource leaks (RESOURCE_LEAK) Variable "fos" going out of scope leaks the resource it refers to. 299 ks.store(fos, password); 300 fos.close(); 301 } -- This message was sent by Atlassian JIRA (v6.3.4#6332)