From 70ec4c904ea372efcd77f35a5d0c1e60173163f4 Mon Sep 17 00:00:00 2001 From: Peter O'Gorman Date: Thu, 13 Oct 2005 04:48:50 +0000 Subject: [PATCH] * libltdl/ltdl.c (find_module): Check that dir is set. (load_deplibs): Don't free the user search paths too early. --- ChangeLog | 5 +++++ libltdl/ltdl.c | 17 +++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41c9a402f..71082b3ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-10-13 Peter O'Gorman + + * libltdl/ltdl.c (find_module): Check that dir is set. + (load_deplibs): Don't free the user search paths too early. + 2005-10-10 Gary V. Vaughan * ltdl.m4 (AC_LTDL_ENABLE_INSTALL): Remove bogus extra diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index bc27b3656..3da37c85c 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -2553,8 +2553,8 @@ find_module (handle, dir, libdir, dlname, old_name, installed) /* maybe it was moved to another directory */ { - if (tryall_dlopen_module (handle, - (const char *) 0, dir, dlname) == 0) + if (dir && (tryall_dlopen_module (handle, + (const char *) 0, dir, dlname) == 0)) return 0; } } @@ -2881,12 +2881,6 @@ load_deplibs (handle, deplibs) } } - /* restore the old search path */ - LT_DLFREE (user_search_path); - user_search_path = save_search_path; - - LT_DLMUTEX_UNLOCK (); - if (!depcount) { errors = 0; @@ -2973,6 +2967,13 @@ load_deplibs (handle, deplibs) cleanup: LT_DLFREE (names); + /* restore the old search path */ + if (user_search_path) { + LT_DLFREE (user_search_path); + user_search_path = save_search_path; + } + LT_DLMUTEX_UNLOCK (); + #endif return errors; -- 2.47.3