summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoracurtis/antony@xiphis.org/ltamd64.xiphis.org <>2008-02-19 13:46:54 -0800
committeracurtis/antony@xiphis.org/ltamd64.xiphis.org <>2008-02-19 13:46:54 -0800
commitd2ad8286a0e3abb63dd7789c9077b628467ff3e4 (patch)
treeb4c1b6b83eac45a53bc54569c2e3c89c88eb35b2
parentf6c3587eab462d9e211337690164f8e7fc4f307a (diff)
downloadmariadb-git-d2ad8286a0e3abb63dd7789c9077b628467ff3e4.tar.gz
backport valgrind cleanups from 6.0-engines
-rw-r--r--mysql-test/valgrind.supp13
-rw-r--r--strings/strmake.c6
2 files changed, 16 insertions, 3 deletions
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index a4fb488a3d6..cb1b07c83b0 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -495,3 +495,16 @@
fun:_db_enter_
fun:kill_server
}
+
+#
+# Warning caused by small memory leak in threaded dlopen
+#
+
+{
+ dlopen threaded memory leak
+ Memcheck:Leak
+ fun:calloc
+ obj:*/libdl-*.so
+ fun:dlopen*
+}
+
diff --git a/strings/strmake.c b/strings/strmake.c
index df8d78e8476..2d5fa5e36aa 100644
--- a/strings/strmake.c
+++ b/strings/strmake.c
@@ -41,9 +41,9 @@ char *strmake(register char *dst, register const char *src, size_t length)
write a character rather than '\0' as this makes spotting these
problems in the results easier.
*/
- uint n= strlen(src) + 1;
- if (n <= length)
- memset(dst + n, (int) 'Z', length - n + 1);
+ uint n= 0;
+ while (n < length && src[n++]);
+ memset(dst + n, (int) 'Z', length - n + 1);
#endif
while (length--)