diff options
author | geneticdrift <geneticdrift@iotide.com> | 2014-02-06 23:08:24 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-06 23:08:24 +0100 |
commit | 0f1f509be7c0c8c40c5dbd9b4cb7aebaa5b4dd59 (patch) | |
tree | 5e4fd485be5ecd156f2cd392d7907b2aed7a5c58 /src | |
parent | c8f0c7e9ede1cfef49ea9d4b71b6b56b4ae87141 (diff) | |
download | mpd-0f1f509be7c0c8c40c5dbd9b4cb7aebaa5b4dd59.tar.gz mpd-0f1f509be7c0c8c40c5dbd9b4cb7aebaa5b4dd59.tar.xz mpd-0f1f509be7c0c8c40c5dbd9b4cb7aebaa5b4dd59.zip |
fixed leaked LocalDirectoryReader *const reader in UpdateWalk::UpdateDirectory
Diffstat (limited to 'src')
-rw-r--r-- | src/db/update/Walk.cxx | 6 |
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; } |