From: Gary V. Vaughan Date: Sun, 16 Jan 2000 23:20:47 +0000 (+0000) Subject: * libltdl/ltdl.c (find_file): memory error fixed. X-Git-Tag: release-1-3d~220 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8697488d346288e67c26c5bedd65d0d1310d4ba7;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (find_file): memory error fixed. --- diff --git a/ChangeLog b/ChangeLog index d311db253..f50e86b56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-01-16 Gary V. Vaughan + + * libltdl/ltdl.c (find_file): memory error fixed. + 2000-01-14 Gary V. Vaughan * ltconfig.in (Usage): Now it matches the code! diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index cb86a5d69..d06fee2f9 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -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; }