Browse Source

libobs/util: Check for null pointer before calling dlclose

Apparently dlclose can crash if you use it with a null pointer.
jp9000 9 years ago
parent
commit
1c37200549
1 changed files with 2 additions and 1 deletions
  1. 2 1
      libobs/util/platform-nix.c

+ 2 - 1
libobs/util/platform-nix.c

@@ -68,7 +68,8 @@ void *os_dlsym(void *module, const char *func)
 
 
 void os_dlclose(void *module)
 void os_dlclose(void *module)
 {
 {
-	dlclose(module);
+	if (module)
+		dlclose(module);
 }
 }
 
 
 #if !defined(__APPLE__)
 #if !defined(__APPLE__)