From: Alexandre Oliva Date: Wed, 27 Jan 1999 06:05:44 +0000 (+0000) Subject: * libltdl/ltdl.c (find_file): oops, filenamesize was miscomputed X-Git-Tag: release-1-2f~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf0865ed59da807a14aeb39c54d8f6da43702849;p=thirdparty%2Flibtool.git * libltdl/ltdl.c (find_file): oops, filenamesize was miscomputed --- diff --git a/ChangeLog b/ChangeLog index 61ba35ba7..6a85cb87c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 1999-01-27 Alexandre Oliva + * libltdl/ltdl.c (find_file): oops, filenamesize was miscomputed + * libltdl/ltdl.c (find_file): allocate filename dynamically * libltdl/configure.in (AC_PROG_LIBTOOL): automake does not diff --git a/libltdl/ltdl.c b/libltdl/ltdl.c index 22e89b533..3c667fe72 100644 --- a/libltdl/ltdl.c +++ b/libltdl/ltdl.c @@ -904,10 +904,9 @@ find_file (basename, search_path, pdir, handle) if (lendir + 1 + lenbase >= filenamesize) { if (filename) free(filename); - filename = (char*) malloc(lendir + 1 + lenbase); - if (filename) - filenamesize = filename; - else { + filenamesize = lendir + 1 + lenbase + 1; + filename = (char*) malloc(filenamesize); + if (!filename) { last_error = memory_error; return 0; }