Main: check if database exists before attempting to close it
Fixes nullptr dereference.
This commit is contained in:
parent
6da0af94df
commit
ff62b6742b
@ -595,8 +595,11 @@ int mpd_main(int argc, char *argv[])
|
|||||||
|
|
||||||
#ifdef ENABLE_DATABASE
|
#ifdef ENABLE_DATABASE
|
||||||
delete instance->update;
|
delete instance->update;
|
||||||
|
|
||||||
|
if (instance->database != nullptr) {
|
||||||
instance->database->Close();
|
instance->database->Close();
|
||||||
delete instance->database;
|
delete instance->database;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_SQLITE
|
#ifdef ENABLE_SQLITE
|
||||||
|
Loading…
Reference in New Issue
Block a user