#vulnerable code 
                                public static Client getClient(Map stormConf, String boltType) {
        String host = ConfUtils.getString(stormConf, "es." + boltType
                + ".hostname");

        String clustername = ConfUtils.getString(stormConf, "es." + boltType
                + ".cluster.name", "elasticsearch");

        // Use Node client if no host is specified
        // ES will try to find the cluster automatically
        // and join it
        if (StringUtils.isBlank(host)) {
            Node node = org.elasticsearch.node.NodeBuilder
                    .nodeBuilder()
                    .settings(
                            ImmutableSettings.settingsBuilder().put(
                                    "http.enabled", false))
                    .clusterName(clustername).client(true).node();
            return node.client();
        }

        // if a transport address has been specified
        // use the transport client - even if it is localhost
        Settings settings = ImmutableSettings.settingsBuilder()
                .put("cluster.name", clustername).build();
        return new TransportClient(settings)
                .addTransportAddress(new InetSocketTransportAddress(host, 9300));
    } 
                            #location 26 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public static Client getClient(Map stormConf, String boltType) {
        List<String> hosts = new LinkedList<>();

        Object addresses = stormConf.get("es." + boltType + ".addresses");
        // list
        if (addresses instanceof PersistentVector) {
            hosts.addAll((PersistentVector) addresses);
        }
        // single value?
        else {
            hosts.add(addresses.toString());
        }

        String clustername = ConfUtils.getString(stormConf, "es." + boltType
                + ".cluster.name", "elasticsearch");

        // Use Node client if no host is specified
        // ES will try to find the cluster automatically
        // and join it
        if (hosts.size() == 0) {
            Node node = org.elasticsearch.node.NodeBuilder
                    .nodeBuilder()
                    .settings(
                            ImmutableSettings.settingsBuilder().put(
                                    "http.enabled", false))
                    .clusterName(clustername).client(true).node();
            return node.client();
        }

        // if a transport address has been specified
        // use the transport client - even if it is localhost
        Settings settings = ImmutableSettings.settingsBuilder()
                .put("cluster.name", clustername).build();
        TransportClient tc = new TransportClient(settings);
        for (String host : hosts) {
            String[] hostPort = host.split(":");
            // no port specified? use default one
            int port = 9300;
            if (hostPort.length == 2) {
                port = Integer.parseInt(hostPort[1].trim());
            }
            InetSocketTransportAddress ista = new InetSocketTransportAddress(
                    hostPort[0].trim(), port);
            tc.addTransportAddress(ista);
        }

        return tc;
    }