From 47491fdaa176c34e41a0a2958bb81dd472b5352e Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 13 Aug 2001 22:53:39 +0000 Subject: [PATCH] * libltdl/ltdl.c (find_file_callback): Fix a multiple free() bug. (tryall_dlopen_module): Remove some unused variables. --- ChangeLog | 6 +++++- libltdl/ltdl.c | 15 ++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7580123f7..05758b902 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,12 @@ 2001-08-13 Gary V. Vaughan + * libltdl/ltdl.c (find_file_callback): Fix a multiple free() + bug. + (tryall_dlopen_module): Remove some unused variables. + * libltdl/ltdl.c (lt_dlinsertsearchdir): Calculate the address of the end of user_search_path correctly. - + * libltdl/ltdl.c (rpl_argz_stringify): New fallback implementation. * ltdl.m4 (AC_LTDL_FUNC_ARGZ): Test for argz_stringify in libc. * libltdl/ltdl.c (lt_argz_insertinorder): Renamed from diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index c1ef7e376..c1afdd9c8 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -1944,7 +1944,7 @@ tryall_dlopen_module (handle, prefix, dirname, dlname) if (!filename) return 1; - sprintf (filename, "%.*s/%s", dirname_len, dirname, dlname); + sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname); /* Now that we have combined DIRNAME and MODULENAME, if there is also a PREFIX to contend with, simply recurse with the arguments @@ -1971,9 +1971,6 @@ find_module (handle, dir, libdir, dlname, old_name, installed) const char *old_name; int installed; { - int error; - char *filename; - /* Try to open the old library first; if it was dlpreopened, we want the preopened version of it, even if a dlopenable module is available. */ @@ -1985,8 +1982,6 @@ find_module (handle, dir, libdir, dlname, old_name, installed) /* Try to open the dynamic library. */ if (dlname) { - size_t len; - /* try to open the installed module */ if (installed && libdir) { @@ -2200,14 +2195,12 @@ find_file_callback (filename, data1, data2) { char *dirend = strrchr (filename, '/'); - LT_DLFREE (*pdir); - *pdir = filename; - filename = 0; - if (dirend > filename) *dirend = LT_EOS_CHAR; - is_done = 1; + LT_DLFREE (*pdir); + *pdir = lt_estrdup (filename); + is_done = (*pdir == 0) ? -1 : 1; } return is_done; -- 2.47.3