Commit 0f1f509b authored by geneticdrift's avatar geneticdrift Committed by Max Kellermann

fixed leaked LocalDirectoryReader *const reader in UpdateWalk::UpdateDirectory

parent c8f0c7e9
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <memory>
UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener, UpdateWalk::UpdateWalk(EventLoop &_loop, DatabaseListener &_listener,
Storage &_storage) Storage &_storage)
...@@ -320,9 +321,8 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info) ...@@ -320,9 +321,8 @@ UpdateWalk::UpdateDirectory(Directory &directory, const FileInfo &info)
directory_set_stat(directory, info); directory_set_stat(directory, info);
Error error; Error error;
StorageDirectoryReader *const reader = const std::auto_ptr<StorageDirectoryReader> reader(storage.OpenDirectory(directory.GetPath(), error));
storage.OpenDirectory(directory.GetPath(), error); if (reader.get() == nullptr) {
if (reader == nullptr) {
LogError(error); LogError(error);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment