Skip to content

Commit

Permalink
UGHUtils: Fix resource leak
Browse files Browse the repository at this point in the history
CID 44587 (#1 of 1): Resource leak on an exceptional path (RESOURCE_LEAK)

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Sep 23, 2016
1 parent 5febdd6 commit 233d259
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,16 +198,14 @@ static void replaceMetadatum(DocStruct inStruct, Prefs inPrefs, String inMetadat
// TODO: Create a own class for iso 639 (?) Mappings or move this to UGH
static String convertLanguage(String inLanguage) {
/* Datei zeilenweise durchlaufen und die Sprache vergleichen */
try {
BufferedReader in = open(PicaPlugin.LANGUAGES_MAPPING_FILE);
try (BufferedReader in = open(PicaPlugin.LANGUAGES_MAPPING_FILE)) {
String str;
while ((str = in.readLine()) != null) {
if (str.length() > 0 && str.split(" ")[1].equals(inLanguage)) {
in.close();
return str.split(" ")[0];
}
}
in.close();
} catch (IOException e) {
}
return inLanguage;
Expand Down

0 comments on commit 233d259

Please sign in to comment.