From b1d60b5c85608df13c8032d0582125ad0ab4dd28 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 26 Feb 2016 13:21:27 +0100 Subject: [PATCH] TagArchive: use InputStreamPtr --- src/TagArchive.cxx | 9 ++++----- 1 file 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); }