import from branch_1_1:
[freeradius.git] / libltdl / ltdl.c
index 57c2a39..5fa663b 100644 (file)
@@ -3500,6 +3500,10 @@ lt_dlopenext (filename)
     LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB));
     return 0;  /* leaks tmp and handle */
   }
+  if (handle && errors) {
+    LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB));
+    return 0;  /* leaks tmp and handle */
+  }
 
   /* If we found FILENAME, stop searching -- whether we were able to
      load the file as a module or not.  If the file exists but loading
@@ -3526,6 +3530,10 @@ lt_dlopenext (filename)
   else
     {
       tmp[len] = LT_EOS_CHAR;
+  if (handle && errors) {
+    LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB));
+    return 0;  /* leaks tmp and handle */
+  }
     }
 
   strcat(tmp, shlib_ext);