]> git.lizzy.rs Git - irrlicht.git/commitdiff
Prevent potential 0 pointer access when release not acquired joystick.
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>
Sat, 19 Nov 2022 16:41:11 +0000 (16:41 +0000)
committersfan5 <sfan5@live.de>
Fri, 24 Mar 2023 16:09:11 +0000 (17:09 +0100)
Found by clang analyser. Not sure if it could really ever have happened, but won't hurt to fix

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6443 dfc29bdd-3216-0410-991c-e03cc46cb475

source/Irrlicht/CIrrDeviceWin32.cpp

index 1033f9edccbed22795d60f7edddb91af81887d2c..7b12232c2450b4bc519bf86cfd2aea211409def4 100644 (file)
@@ -121,8 +121,8 @@ namespace irr
                        if (dev)\r
                        {\r
                                dev->Unacquire();\r
+                               dev->Release();\r
                        }\r
-                       dev->Release();\r
                }\r
 \r
                if (DirectInputDevice)\r