]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (find_file): memory error fixed.
authorGary V. Vaughan <gary@gnu.org>
Sun, 16 Jan 2000 23:20:47 +0000 (23:20 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sun, 16 Jan 2000 23:20:47 +0000 (23:20 +0000)
ChangeLog
libltdl/ltdl.c

index d311db2534d6a698c2451da45d2654c77df3ce12..f50e86b568f2ba291061abcbfa6e2ee0b2602e03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-01-16  Gary V. Vaughan  <gary@oranda.demon.co.uk>
+
+       * libltdl/ltdl.c (find_file): memory error fixed.
+
 2000-01-14  Gary V. Vaughan  <gary@oranda.demon.co.uk>
 
        * ltconfig.in (Usage): Now it matches the code!
index cb86a5d69a713288bc91e49fa896160ae5f241b7..d06fee2f938ee8aebc8698781e0c7e0fda9ccce6 100644 (file)
@@ -1061,17 +1061,18 @@ find_file (basename, search_path, pdir, handle)
        char    *filename = 0;
        int     filenamesize = 0;
        int     lenbase = strlen(basename);
-       char    *next = 0;
+       char    *canonical = 0, *next = 0;
        
        if (!search_path || !*search_path) {
                last_error = file_not_found_error;
                return 0;
        }
-       next = canonicalize_path (search_path);
-       if (!next) {
+       canonical = canonicalize_path (search_path);
+       if (!canonical) {
                last_error = memory_error;
                goto cleanup;
        }
+       next = canonical;
        while (next) {
                int lendir;
                char *cur = next;
@@ -1128,7 +1129,8 @@ find_file (basename, search_path, pdir, handle)
 cleanup:
        if (filename)
                lt_dlfree(filename);
-       lt_dlfree(next);
+       if (canonical)
+               lt_dlfree(canonical);
        return result;
 }