[ioquake3] 56/136: Fix dllHandle possibly being uninitialized in Sys_LoadDll

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit bc2f45508d33c50a23ccd5668ac82f673fec3a83
Author: Zack Middleton <zack at cloemail.com>
Date:   Fri May 26 10:49:42 2017 -0500

    Fix dllHandle possibly being uninitialized in Sys_LoadDll
---
 code/sys/sys_main.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/code/sys/sys_main.c b/code/sys/sys_main.c
index 14179b9..b559861 100644
--- a/code/sys/sys_main.c
+++ b/code/sys/sys_main.c
@@ -498,7 +498,7 @@ from executable path, then fs_basepath.
 
 void *Sys_LoadDll(const char *name, qboolean useSystemLib)
 {
-	void *dllhandle;
+	void *dllhandle = NULL;
 
 	if(!Sys_DllExtension(name))
 	{
@@ -507,9 +507,12 @@ void *Sys_LoadDll(const char *name, qboolean useSystemLib)
 	}
 
 	if(useSystemLib)
+	{
 		Com_Printf("Trying to load \"%s\"...\n", name);
+		dllhandle = Sys_LoadLibrary(name);
+	}
 	
-	if(!useSystemLib || !(dllhandle = Sys_LoadLibrary(name)))
+	if(!dllhandle)
 	{
 		const char *topDir;
 		char libPath[MAX_OSPATH];

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list