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 @@
#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;
}
......
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