aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db/update/Walk.cxx6
1 files changed, 3 insertions, 3 deletions
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 <string.h>
#include <stdlib.h>
#include <errno.h>
+#include <memory>
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<StorageDirectoryReader> reader(storage.OpenDirectory(directory.GetPath(), error));
+ if (reader.get() == nullptr) {
LogError(error);
return false;
}