]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (find_file_callback): Fix a multiple free()
authorGary V. Vaughan <gary@gnu.org>
Mon, 13 Aug 2001 22:53:39 +0000 (22:53 +0000)
committerGary V. Vaughan <gary@gnu.org>
Mon, 13 Aug 2001 22:53:39 +0000 (22:53 +0000)
bug.
(tryall_dlopen_module): Remove some unused variables.

ChangeLog
libltdl/ltdl.c

index 7580123f7fd71f2fd649daacf6f1ff4fa080d576..05758b902cc41d23d4cef81dc3fc3d17d66608a0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,12 @@
 2001-08-13  Gary V. Vaughan  <gary@gnu.org>
 
+       * 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 
index c1ef7e376fa79fda28f753cdd9c3663963fd4549..c1afdd9c8f3ff93694f8393321c883d2237dff9b 100644 (file)
@@ -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;