From 44d0136cb4b532c957d6c037ea6a862a1e371cd9 Mon Sep 17 00:00:00 2001 From: Ennio Barbaro Date: Thu, 2 Jul 2015 23:24:52 +0200 Subject: Fixed bug crash if dlopen fails --- opentrack/plugin-support.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'opentrack') diff --git a/opentrack/plugin-support.hpp b/opentrack/plugin-support.hpp index bc07c106..95b4b0a1 100644 --- a/opentrack/plugin-support.hpp +++ b/opentrack/plugin-support.hpp @@ -115,7 +115,8 @@ struct dylib { { fprintf(stderr, "Error, ignoring: %s\n", err); fflush(stderr); - dlclose(handle); + if (handle) + dlclose(handle); handle = nullptr; return true; } @@ -138,6 +139,7 @@ struct dylib { return; } else { (void) _foo::err(handle); + return; } #endif -- cgit v1.2.3