[APPHELP] Prevent a nullptr dereference 1216/head
authorMark Jansen <mark.jansen@reactos.org>
Thu, 3 Jan 2019 21:17:54 +0000 (22:17 +0100)
committerMark Jansen <mark.jansen@reactos.org>
Sat, 5 Jan 2019 12:11:36 +0000 (13:11 +0100)
dll/appcompat/apphelp/hsdb.c

index 62cd92f..f04312e 100644 (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);
+    }
 }
 
 /**