summaryrefslogtreecommitdiff
path: root/src/db/plugins/simple
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-05-05 18:57:13 +0200
committerMax Kellermann <max@musicpd.org>2020-05-05 18:57:29 +0200
commit209364adf2c143d2979f95f748b9aef642bde0d9 (patch)
treee68c3fd5abfa27630027b53608133098b4ef7295 /src/db/plugins/simple
parent24afdee35ce3ed64823ead05930d452f0fb9e98a (diff)
db/simple: fix crash when mounting twice
The `db->close()` call was a `nullptr` dereference because the `db` variable had already been moved. Closes https://github.com/MusicPlayerDaemon/MPD/issues/839
Diffstat (limited to 'src/db/plugins/simple')
-rw-r--r--src/db/plugins/simple/SimpleDatabasePlugin.cxx7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
index ebb34ee14..5350db6d8 100644
--- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx
+++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx
@@ -449,12 +449,7 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri)
// TODO: update the new database instance?
- try {
- Mount(local_uri, std::move(db));
- } catch (...) {
- db->Close();
- throw;
- }
+ Mount(local_uri, std::move(db));
}
inline DatabasePtr