#fixed code
                                @Test
    public void testSsl1() throws IOException {
//        setJvmTrustStore("src/test/resources/keystore/truststore.jceks", "jceks");
//        Replicator replicator = new RedisReplicator("localhost", 56379,
//                Configuration.defaultSetting().setSsl(true)
//                        .setReadTimeout(0)
//                        .setSslSocketFactory((SSLSocketFactory) SSLSocketFactory.getDefault())
//                        .setHostnameVerifier(new BasicHostnameVerifier())
//                        .setSslParameters(new SSLParameters()));
//        final AtomicInteger acc = new AtomicInteger(0);
//        Jedis jedis = null;
//        try {
//            jedis = new Jedis("127.0.0.1", 6379);
//            jedis.set("ssl1", "true");
//        } finally {
//            jedis.close();
//        }
//        replicator.addRdbFilter(new RdbFilter() {
//            @Override
//            public boolean accept(KeyValuePair<?> kv) {
//                return kv.getKey().equals("ssl1");
//            }
//        });
//        replicator.addRdbListener(new RdbListener() {
//            @Override
//            public void preFullSync(Replicator replicator) {
//            }
//
//            @Override
//            public void handle(Replicator replicator, KeyValuePair<?> kv) {
//                acc.incrementAndGet();
//            }
//
//            @Override
//            public void postFullSync(Replicator replicator, long checksum) {
//                Jedis jedis = null;
//                try {
//                    jedis = new Jedis("127.0.0.1", 6379);
//                    jedis.del("ssl1");
//                } finally {
//                    jedis.close();
//                }
//                try {
//                    replicator.close();
//                } catch (IOException e) {
//                    e.printStackTrace();
//                }
//            }
//        });
//        replicator.addCloseListener(new CloseListener() {
//            @Override
//            public void handle(Replicator replicator) {
//                System.out.println("close testSsl1");
//                assertEquals(1, acc.get());
//            }
//        });
//        replicator.open();
    }
#vulnerable code 
                                @Test
    public void testSsl1() throws IOException {
        setJvmTrustStore("src/test/resources/keystore/truststore.jceks", "jceks");
        Replicator replicator = new RedisReplicator("localhost", 56379,
                Configuration.defaultSetting().setSsl(true)
                        .setReadTimeout(0)
                        .setSslSocketFactory((SSLSocketFactory) SSLSocketFactory.getDefault())
                        .setHostnameVerifier(new BasicHostnameVerifier())
                        .setSslParameters(new SSLParameters()));
        final AtomicInteger acc = new AtomicInteger(0);
        Jedis jedis = null;
        try {
            jedis = new Jedis("127.0.0.1", 6379);
            jedis.set("ssl1", "true");
        } finally {
            jedis.close();
        }
        replicator.addRdbFilter(new RdbFilter() {
            @Override
            public boolean accept(KeyValuePair<?> kv) {
                return kv.getKey().equals("ssl1");
            }
        });
        replicator.addRdbListener(new RdbListener() {
            @Override
            public void preFullSync(Replicator replicator) {
            }

            @Override
            public void handle(Replicator replicator, KeyValuePair<?> kv) {
                acc.incrementAndGet();
            }

            @Override
            public void postFullSync(Replicator replicator, long checksum) {
                Jedis jedis = null;
                try {
                    jedis = new Jedis("127.0.0.1", 6379);
                    jedis.del("ssl1");
                } finally {
                    jedis.close();
                }
                try {
                    replicator.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        });
        replicator.addCloseListener(new CloseListener() {
            @Override
            public void handle(Replicator replicator) {
                System.out.println("close testSsl1");
                assertEquals(1, acc.get());
            }
        });
        replicator.open();
    } 
                            #location 57 
                            #vulnerability type RESOURCE_LEAK