Commit 7e9e20e3 authored by unknown's avatar unknown

Fixed memory leak in send_file


mysql-test/t/myisam.test:
  Cleanup test
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
parent 851bb139
......@@ -22,6 +22,7 @@ monty@bitch.mysql.fi
monty@donna.mysql.fi
monty@hundin.mysql.fi
monty@mashka.mysql.fi
monty@mishka.mysql.fi
monty@narttu.
monty@narttu.mysql.fi
monty@tik.
......
......@@ -284,5 +284,4 @@ insert into t1 values (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, "Sergei");
drop table if exists t1;
drop table t1;
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment