#At file:///home/bm136801/my/upmerge-60/ based on revid:bjorn.munch@stripped
2861 Bjorn Munch 2009-10-05
Bug #47305 Test backup.backup_log_filesize fails on gcov builds
Crashes in getenv()
Don't free string sent to putenv, allocate with "once"
modified:
client/mysqltest.cc
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2009-09-23 05:54:19 +0000
+++ b/client/mysqltest.cc 2009-10-05 08:22:15 +0000
@@ -1952,7 +1952,6 @@ VAR *var_init(VAR *v, const char *name,
void var_free(void *v)
{
my_free(((VAR*) v)->str_val, MYF(MY_WME));
- my_free(((VAR*) v)->env_s, MYF(MY_WME|MY_ALLOW_ZERO_PTR));
if (((VAR*)v)->alloced)
my_free(v, MYF(MY_WME));
}
@@ -2083,7 +2082,7 @@ void var_set(const char *var_name, const
my_snprintf(buf, sizeof(buf), "%.*s=%.*s",
v->name_len, v->name,
v->str_val_len, v->str_val);
- if (!(v->env_s= my_strdup(buf, MYF(MY_WME))))
+ if (!(v->env_s= my_once_strdup(buf, MYF(MY_WME))))
die("Out of memory");
putenv(v->env_s);
my_free(old_env_s, MYF(MY_ALLOW_ZERO_PTR));
Attachment: [text/bzr-bundle] bzr/bjorn.munch@sun.com-20091005082215-f1olshi6ao2954ch.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0-mtr branch (Bjorn.Munch:2861) Bug#47305 | Bjorn Munch | 5 Oct |