summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/TagArchive.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/TagArchive.cxx b/src/TagArchive.cxx
index 777a7fe5f..1da2d72f2 100644
--- a/src/TagArchive.cxx
+++ b/src/TagArchive.cxx
@@ -35,11 +35,10 @@ tag_archive_scan(Path path, const TagHandler &handler, void *handler_ctx)
Mutex mutex;
Cond cond;
- auto *is = OpenArchiveInputStream(path, mutex, cond, IgnoreError());
- if (is == nullptr)
+ InputStreamPtr is(OpenArchiveInputStream(path, mutex, cond,
+ IgnoreError()));
+ if (!is)
return false;
- bool result = tag_stream_scan(*is, handler, handler_ctx);
- delete is;
- return result;
+ return tag_stream_scan(*is, handler, handler_ctx);
}