From 0f1f509be7c0c8c40c5dbd9b4cb7aebaa5b4dd59 Mon Sep 17 00:00:00 2001 From: geneticdrift Date: Thu, 6 Feb 2014 23:08:24 +0100 Subject: fixed leaked LocalDirectoryReader *const reader in UpdateWalk::UpdateDirectory --- src/db/update/Walk.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/db/update/Walk.cxx b/src/db/update/Walk.cxx index 5750f0223..0ea1eb450 100644 --- a/src/db/update/Walk.cxx +++ b/src/db/update/Walk.cxx @@ -47,6 +47,7 @@ #include #include #include +#include UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener, Storage &_storage) @@ -320,9 +321,8 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info) directory_set_stat(directory, info); Error error; - StorageDirectoryReader *const reader = - storage.OpenDirectory(directory.GetPath(), error); - if (reader == nullptr) { + const std::auto_ptr reader(storage.OpenDirectory(directory.GetPath(), error)); + if (reader.get() == nullptr) { LogError(error); return false; } -- cgit v1.2.3