From bf0865ed59da807a14aeb39c54d8f6da43702849 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 27 Jan 1999 06:05:44 +0000 Subject: [PATCH] * libltdl/ltdl.c (find_file): oops, filenamesize was miscomputed --- ChangeLog | 2 ++ libltdl/ltdl.c | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61ba35ba..6a85cb87 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 22e89b53..3c667fe7 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; }