#vulnerable code 
                                public static void main(String[] args) throws IOException {
        final Replicator replicator = new RedisReplicator(
                "127.0.0.1", 6379,
                Configuration.defaultSetting());

        replicator.addRdbListener(new RdbListener.Adaptor() {
            @Override
            public void handle(Replicator replicator, KeyValuePair<?> kv) {
                System.out.println(kv);
            }
        });

        replicator.addCommandListener(new CommandListener() {
            @Override
            public void handle(Replicator replicator, Command command) {
                System.out.println(command);
            }
        });

        replicator.open();
    } 
                            #location 20 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public static void main(String[] args) throws Exception {
        final Replicator replicator = new RedisReplicator("redis://127.0.0.1:6379");

        replicator.addRdbListener(new RdbListener.Adaptor() {
            @Override
            public void handle(Replicator replicator, KeyValuePair<?> kv) {
                System.out.println(kv);
            }
        });

        replicator.addCommandListener(new CommandListener() {
            @Override
            public void handle(Replicator replicator, Command command) {
                System.out.println(command);
            }
        });

        replicator.open();
    }