strcpy (tmp, filename);
strcat (tmp, archive_ext);
errors = try_dlopen (&handle, tmp);
+ 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
strcat(tmp, shlib_ext);
errors = try_dlopen (&handle, tmp);
+ if (handle && errors) {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FR_DEPLIB));
+ return 0; /* leaks tmp and handle */
+ }
/* As before, if the file was found but loading failed, return now
with the current error message. */
LT_ERROR(SHUTDOWN, "library already shutdown") \
LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \
LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \
- LT_ERROR(INVALID_POSITION, "invalid search path insert position")
+ LT_ERROR(INVALID_POSITION, "invalid search path insert position") \
+ LT_ERROR(FR_DEPLIB, "dep lib loading bug, please report to freeradius-devel@lists.freeradius.org")
/* Enumerate the symbolic error names. */
enum {