diff options
author | unknown <monty@mishka.mysql.fi> | 2003-10-08 21:02:53 +0300 |
---|---|---|
committer | unknown <monty@mishka.mysql.fi> | 2003-10-08 21:02:53 +0300 |
commit | 7e9e20e3c2f686778efe0d0e184cfaefd77821c1 (patch) | |
tree | be499d0bf60102fffc0ab183646b048fe97d28cf /sql | |
parent | 851bb139afbd0c62c9c56ed96a8c2637a9ccc2e6 (diff) | |
download | mariadb-git-7e9e20e3c2f686778efe0d0e184cfaefd77821c1.tar.gz |
Fixed memory leak in send_file
mysql-test/t/myisam.test:
Cleanup test
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_repl.cc | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 1940ff360c2..49e13f0e415 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -66,10 +66,10 @@ static int send_file(THD *thd) NET* net = &thd->net; int fd = -1,bytes, error = 1; char fname[FN_REFLEN+1]; - char *buf; const char *errmsg = 0; int old_timeout; uint packet_len; + char buf[IO_SIZE]; // It's safe to alloc this DBUG_ENTER("send_file"); // the client might be slow loading the data, give him wait_timeout to do @@ -77,13 +77,6 @@ static int send_file(THD *thd) old_timeout = thd->net.timeout; thd->net.timeout = thd->inactive_timeout; - // spare the stack - if(!(buf = alloc_root(&thd->mem_root,IO_SIZE))) - { - errmsg = "Out of memory"; - goto err; - } - // we need net_flush here because the client will not know it needs to send // us the file name until it has processed the load event entry if (net_flush(net) || (packet_len = my_net_read(net)) == packet_error) |