Skip to content

Commit

Permalink
Fix pfPasswordStore leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoikas committed Sep 6, 2020
1 parent 7331c13 commit 0d4b2a5
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Sources/Plasma/FeatureLib/pfPasswordStore/pfPasswordStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
/* Get the pfPasswordStore instance */
pfPasswordStore* pfPasswordStore::Instance()
{
static pfPasswordStore* store = nullptr;

if (store == nullptr) {
#if defined(HS_BUILD_FOR_WIN32)
store = new pfWin32PasswordStore();
static pfWin32PasswordStore store;
#elif defined(HS_BUILD_FOR_APPLE)
store = new pfApplePasswordStore();
static pfMacPasswordStore store;
#elif defined(HAVE_LIBSECRET)
store = new pfUnixPasswordStore();
static pfUnixPasswordStore store;
#else
store = new pfFilePasswordStore();
static pfFilePasswordStore store;
#endif
}

return store;
return &store;
}


Expand Down

0 comments on commit 0d4b2a5

Please sign in to comment.