updated for version 7.0-026
diff --git a/src/os_unix.c b/src/os_unix.c
index 0059d30..b375468 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -5757,8 +5757,13 @@
     int		retval_int = 0;
     int		success = FALSE;
 
-    /* Get a handle to the DLL module. */
+    /*
+     * Get a handle to the DLL module.
+     */
 # if defined(USE_DLOPEN)
+    /* First clear any error, it's not cleared by the dlopen() call. */
+    (void)dlerror();
+
     hinstLib = dlopen((char *)libname, RTLD_LAZY
 #  ifdef RTLD_LOCAL
 	    | RTLD_LOCAL