hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-7672) Potential resource leak in EximUtil#createExportDump()
Date Wed, 15 Jul 2015 01:19:04 GMT

     [ https://issues.apache.org/jira/browse/HIVE-7672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ted Yu updated HIVE-7672:
-------------------------
    Description: 
Here is related code:
{code}
      OutputStream out = fs.create(metadataPath);
      out.write(jsonContainer.toString().getBytes("UTF-8"));
      out.close();
{code}

If out.write() throws exception, out would be left unclosed.
out.close() should be enclosed in finally block.

  was:
Here is related code:
{code}
      OutputStream out = fs.create(metadataPath);
      out.write(jsonContainer.toString().getBytes("UTF-8"));
      out.close();
{code}
If out.write() throws exception, out would be left unclosed.
out.close() should be enclosed in finally block.


> Potential resource leak in EximUtil#createExportDump()
> ------------------------------------------------------
>
>                 Key: HIVE-7672
>                 URL: https://issues.apache.org/jira/browse/HIVE-7672
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: SUYEON LEE
>            Priority: Minor
>         Attachments: HIVE-7672.patch
>
>
> Here is related code:
> {code}
>       OutputStream out = fs.create(metadataPath);
>       out.write(jsonContainer.toString().getBytes("UTF-8"));
>       out.close();
> {code}
> If out.write() throws exception, out would be left unclosed.
> out.close() should be enclosed in finally block.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message