aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-09 13:16:32 +0100
committerMax Kellermann <max@duempel.org>2014-01-09 13:21:09 +0100
commit83a988e2e48b85afe87c48f6a25d596b0c56054c (patch)
tree00ea8084a0f073dba8515733a9e48267a90ec903 /src
parent91efe1cb5ab4499512bf74b45221e800cc048726 (diff)
downloadmpd-83a988e2e48b85afe87c48f6a25d596b0c56054c.tar.gz
mpd-83a988e2e48b85afe87c48f6a25d596b0c56054c.tar.xz
mpd-83a988e2e48b85afe87c48f6a25d596b0c56054c.zip
db/proxy: allocate Directory instance on the stack
Diffstat (limited to 'src')
-rw-r--r--src/db/ProxyDatabasePlugin.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/db/ProxyDatabasePlugin.cxx b/src/db/ProxyDatabasePlugin.cxx
index a9da1717d..20eb196a6 100644
--- a/src/db/ProxyDatabasePlugin.cxx
+++ b/src/db/ProxyDatabasePlugin.cxx
@@ -360,13 +360,9 @@ Visit(struct mpd_connection *connection, Directory &root,
{
const char *path = mpd_directory_get_path(directory);
- if (visit_directory) {
- Directory *d = Directory::NewGeneric(path, &root);
- bool success = visit_directory(*d, error);
- d->Free();
- if (!success)
- return false;
- }
+ if (visit_directory &&
+ !visit_directory(Directory(path, &root), error))
+ return false;
if (recursive &&
!Visit(connection, root, path, recursive, filter,