#vulnerable code 
                                public void service() {
        int i = 0;
        try {
            serverSocket = new ServerSocket(port);
        } catch (IOException e1) {
            e1.printStackTrace();
        }

        while (true) {
            Socket socket = null;
            try {
                i++;
                socket = serverSocket.accept(); // 主线程获取客户端连接
                System.out.println("第" + i + "个客户端成功连接！");
                Thread workThread = new Thread(new Handler(socket)); // 创建线程
                workThread.start(); // 启动线程
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void service() {
        int i = 0;
        try {
            serverSocket = new ServerSocket(port);
        } catch (BindException e) {
            LOGGER.error("端口绑定错误", e.getCause());
            throw new RuntimeException("端口已经被绑定");
        } catch (IOException e1) {
            LOGGER.error("其他错误", e1.getCause());
            throw new RuntimeException(e1.getMessage());
        }

        while (true) {
            Socket socket = null;
            try {
                i++;
                socket = serverSocket.accept(); // 主线程获取客户端连接
                LOGGER.debug("第{}个客户端成功连接！", i);
                Thread workThread = new Thread(new Handler(socket)); // 创建线程
                workThread.start(); // 启动线程
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }