Applied to HEAD: we were allocating too much memory. No, Coverity did
not find that out. Yes, valgrind starts complaining very loudly on
mdemo when I make it just one byte shorter than what it's now.
FWIW, with mdemo, valgrind on Linux/x86 does have quite a few false
positives inside libdl's dlopen and friends, presumably due to optimized
string functions accessing several bytes at once (so all my tests have
been comparing errors before and afterwards).
Cheers,
Ralf
2007-09-01 Ralf Wildenhues <[EMAIL PROTECTED]>
* libltdl/ltdl.c (tryall_dlopen_module): Fix string length
computation: do not allocate more than needed.
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.258
diff -u -r1.258 ltdl.c
--- libltdl/ltdl.c 30 Aug 2007 18:23:24 -0000 1.258
+++ libltdl/ltdl.c 1 Sep 2007 08:07:17 -0000
@@ -484,7 +484,7 @@
/* Allocate memory, and combine DIRNAME and MODULENAME into it.
The PREFIX (if any) is handled below. */
- filename = MALLOC (char, dirname_len + 1 + filename_len + 1);
+ filename = MALLOC (char, filename_len + 1);
if (!filename)
return 1;