From 2dcd12a85628a81658d22fe203e3dd4ea050138e Mon Sep 17 00:00:00 2001 From: Peter O'Gorman Date: Thu, 13 Oct 2005 04:48:36 +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 | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8610ba4d3..acf66de96 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-11 Ralf Wildenhues * tests/testsuite.at (LT_AT_AUTOMAKE): New macro. diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index dd9cc715b..c27406470 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -473,8 +473,8 @@ find_module (lt_dlhandle *handle, const char *dir, const char *libdir, /* 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; } } @@ -774,8 +774,6 @@ load_deplibs (lt_dlhandle handle, char *deplibs) } } - /* restore the old search path */ - MEMREASSIGN (user_search_path, save_search_path); if (!depcount) { @@ -864,6 +862,10 @@ load_deplibs (lt_dlhandle handle, char *deplibs) cleanup: FREE (names); + /* restore the old search path */ + if (save_search_path) { + MEMREASSIGN (user_search_path, save_search_path); + } #endif return errors; -- 2.47.3