[APPHELP] Prevent a nullptr dereference

This commit is contained in:
Mark Jansen 2019-01-03 22:17:54 +01:00
parent 6969e85b29
commit e984cabad2
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B

View file

@ -1,10 +1,10 @@
/*
* PROJECT: ReactOS Application compatibility module
* LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Shim matching / data (un)packing
* COPYRIGHT: Copyright 2011 André Hentschel
* Copyright 2013 Mislav Blaževic
* Copyright 2015-2018 Mark Jansen (mark.jansen@reactos.org)
* Copyright 2015-2019 Mark Jansen (mark.jansen@reactos.org)
*/
#define WIN32_NO_STATUS
@ -416,8 +416,11 @@ HSDB WINAPI SdbInitDatabase(DWORD flags, LPCWSTR path)
*/
void WINAPI SdbReleaseDatabase(HSDB hsdb)
{
SdbCloseDatabase(hsdb->pdb);
SdbFree(hsdb);
if (hsdb)
{
SdbCloseDatabase(hsdb->pdb);
SdbFree(hsdb);
}
}
/**