From 1a8114af8e13c0118f89ff73c938d0857c0cdabe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 25 Jun 2017 12:34:48 +0200 Subject: [PATCH] Proper cleanup. --- src/tar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tar.cpp b/src/tar.cpp index a14648d9..2455c67e 100644 --- a/src/tar.cpp +++ b/src/tar.cpp @@ -73,12 +73,14 @@ bool Tar::loadTar() while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) { if (ret < BLOCKSIZE) { _file.close(); + _index.clear(); return false; } size = number(hdr->size, sizeof(hdr->size)); _index.insert(hdr->name, _file.pos() / BLOCKSIZE - 1); if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) { _file.close(); + _index.clear(); return false; } }