square / tape

A lightning fast, transactional, file-based FIFO for Android and Java.
https://square.github.io/tape/
Apache License 2.0
2.47k stars 287 forks source link

Leak of file descriptor when creating QueueFile from corrupted queue file. #204

Open MacSwinarski opened 5 years ago

MacSwinarski commented 5 years ago

Leak of file descriptors in QueueFile constructor.

public QueueFile(File file) throws IOException {
    if (!file.exists()) initialize(file);
    raf = open(file);
    readHeader();
  }

When readHeader() throws and exception raf is never closed.

MacSwinarski commented 5 years ago

Would you accept a PR with a 1.2.4-SNAPSHOT branch with the fix?