try_dlopen() has a bug: it sometimes returns a handle if a dependency
library can't be loaded. It also returns an error status, however
lt_dlopenext() doesn't handle this well and returns the invalid handle.
This causes a segfault instead of a graceful exit. Update ltdl to
give an error telling the user to report the problem, so that we can
try to reproduce it and report to the libtool folks. We could just
leave ltdl unpatched; FR will exit either way.
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
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);