#vulnerable code 
                                public void wallet(final String uid, final String bank,
        final String wallet) throws IOException {
        if (!bank.matches("paypal")) {
            throw new SoftException(
                new Par(
                    "Bank name `%s` is invalid,",
                    "we accept only `paypal`, see §20"
                ).say(bank)
            );
        }
        final Pattern email = Pattern.compile(
            "\\b[\\w.%-]+@[-.\\w]+\\.[A-Za-z]{2,4}\\b"
        );
        if (!email.matcher(wallet).matches()) {
            throw new SoftException(
                String.format(
                    "Email `%s` is not valid",
                    wallet
                )
            );
        }
        try (final Item item = this.item()) {
            new Xocument(item.path()).modify(
                People.start(uid)
                    .addIf("wallet")
                    .set(wallet)
                    .attr("bank", bank)
            );
        }
    } 
                            #location 8 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void wallet(final String uid, final String bank,
        final String wallet) throws IOException {
        if (!bank.matches("paypal|btc|bch|eth|ltc")) {
            throw new SoftException(
                new Par(
                    "Bank name `%s` is invalid, we accept only",
                    "`paypal`, `btc`, `bch`, `eth`, or `ltc`, see §20"
                ).say(bank)
            );
        }
        if ("paypal".equals(wallet)
            && !wallet.matches("\\b[\\w.%-]+@[-.\\w]+\\.[A-Za-z]{2,4}\\b")) {
            throw new SoftException(
                new Par("Email `%s` is not valid").say(wallet)
            );
        }
        if ("btc".equals(wallet)
            && !wallet.matches("(1|3|bc1)[a-zA-Z0-9]{20,40}")) {
            throw new SoftException(
                new Par("Bitcoin address is not valid: `%s`").say(wallet)
            );
        }
        if ("bch".equals(wallet)
            && !wallet.matches("[pq]{41}")) {
            throw new SoftException(
                new Par("Bitcoin Cash address is not valid: `%s`").say(wallet)
            );
        }
        if ("eth".equals(wallet)
            && !wallet.matches("[0-9a-f]{42}")) {
            throw new SoftException(
                new Par("Etherium address is not valid: `%s`").say(wallet)
            );
        }
        if ("ltc".equals(wallet)
            && !wallet.matches("[0-9a-zA-Z]{35}")) {
            throw new SoftException(
                new Par("Litecoin address is not valid: `%s`").say(wallet)
            );
        }
        try (final Item item = this.item()) {
            new Xocument(item.path()).modify(
                People.start(uid)
                    .addIf("wallet")
                    .set(wallet)
                    .attr("bank", bank)
            );
        }
    }