https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e984cabad211bc70c7495…
commit e984cabad211bc70c749571e0d8507e542936d52
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Thu Jan 3 22:17:54 2019 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sat Jan 5 13:11:36 2019 +0100
[APPHELP] Prevent a nullptr dereference
---
dll/appcompat/apphelp/hsdb.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/dll/appcompat/apphelp/hsdb.c b/dll/appcompat/apphelp/hsdb.c
index 62cd92fd05..f04312e034 100644
--- a/dll/appcompat/apphelp/hsdb.c
+++ b/dll/appcompat/apphelp/hsdb.c
@@ -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(a)reactos.org)
+ * Copyright 2015-2019 Mark Jansen (mark.jansen(a)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);
+ }
}
/**