#fixed code
                                @Test
    public void     testNamespaceWithWatcher() throws Exception
    {
        CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder();
        CuratorFramework client = builder.connectString(server.getConnectString()).namespace("aisa").retryPolicy(new RetryOneTime(1)).build();
        client.start();
        try
        {
            final SynchronousQueue<String>  queue = new SynchronousQueue<String>();
            Watcher                         watcher = new Watcher()
            {
                @Override
                public void process(WatchedEvent event)
                {
                    try
                    {
                        queue.put(event.getPath());
                    }
                    catch ( InterruptedException e )
                    {
                        throw new Error(e);
                    }
                }
            };
            client.create().forPath("/base");
            client.getChildren().usingWatcher(watcher).forPath("/base");
            client.create().forPath("/base/child");

            String      path = queue.take();
            Assert.assertEquals(path, "/base");
        }
        finally
        {
            client.close();
        }
    }
#vulnerable code 
                                @Test
    public void     testNamespaceWithWatcher() throws Exception
    {
        CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder();
        CuratorFramework client = builder.connectString(server.getConnectString()).namespace("aisa").retryPolicy(new RetryOneTime(1)).build();
        client.start();
        try
        {
            final SynchronousQueue<String>  queue = new SynchronousQueue<String>();
            Watcher                         watcher = new Watcher()
            {
                @Override
                public void process(WatchedEvent event)
                {
                    try
                    {
                        queue.put(event.getPath());
                    }
                    catch ( InterruptedException e )
                    {
                        throw new Error(e);
                    }
                }
            };
            client.create().forPath("/base", new byte[0]);
            client.getChildren().usingWatcher(watcher).forPath("/base");
            client.create().forPath("/base/child", new byte[0]);

            String      path = queue.take();
            Assert.assertEquals(path, "/base");
        }
        finally
        {
            client.close();
        }
    } 
                            #location 18 
                            #vulnerability type RESOURCE_LEAK