#fixed code
                              @Override
  public void run() {

    ServerSocket socket = null;
    Socket clientSocket = null;
    try {
      socket = new ServerSocket(this.port);
      clientSocket = socket.accept();
      final BufferedInputStream bif = new BufferedInputStream(
          clientSocket.getInputStream());

      sendTests(clientSocket);

      final DataInputStream is = new DataInputStream(bif);
      receiveCoverage(is);

    } catch (final IOException e) {
      throw Unchecked.translateCheckedException(e);
    } finally {
      try {
        if (clientSocket != null) {
          clientSocket.close();
        }

        if (socket != null) {
          socket.close();
        }
      } catch (final IOException e) {
        throw Unchecked.translateCheckedException(e);
      }
    }

  }
#vulnerable code 
                              @Override
  public void run() {

    ServerSocket socket = null;
    try {
      socket = new ServerSocket(this.port);
      final Socket clientSocket = socket.accept();
      final BufferedInputStream bif = new BufferedInputStream(
          clientSocket.getInputStream());
      final DataInputStream is = new DataInputStream(bif);

      Description d = null;
      final CoverageStatistics cs = new CoverageStatistics();

      byte control = is.readByte();
      while (control != CoveragePipe.DONE) {
        switch (control) {
        case CoveragePipe.CLAZZ:

          final int id = is.readInt();
          final String name = is.readUTF();

          final int newId = cs.registerClass(name);
          if (id != newId) {
            throw new PitError("Coverage id out of sync");
          }

          break;
        case CoveragePipe.LINE:

          final int classId = is.readInt();
          final int lineId = is.readInt();

          cs.visitLine(classId, lineId);

          break;
        case CoveragePipe.OUTCOME:

          final boolean isGreen = is.readBoolean();
          final long executionTime = is.readLong();
          final CoverageResult cr = new CoverageResult(d, executionTime,
              isGreen, cs.getClassStatistics());

          this.handler.apply(cr);

          cs.clearCoverageStats();

          break;
        case CoveragePipe.TEST_CHANGE:

          final int index = is.readInt();
          d = this.tus.get(index).getDescription();
          break;
        case CoveragePipe.DONE:

        }
        control = is.readByte();
      }

    } catch (final IOException e) {
      throw Unchecked.translateCheckedException(e);
    } finally {
      if (socket != null) {
        try {
          socket.close();
        } catch (final IOException e) {
          throw Unchecked.translateCheckedException(e);
        }
      }
    }

  } 
                            #location 9 
                            #vulnerability type RESOURCE_LEAK