vweb: fix a leak

pull/5555/head
Alexander Medvednikov 2020-06-28 19:55:53 +02:00
parent d2c508e9a9
commit 3f59f23427
2 changed files with 5 additions and 2 deletions

View File

@ -65,8 +65,11 @@ fn (mut ctx Context) send_response_to_client(mimetype string, res string) bool {
sb.write('\r\n')
sb.write(headers_close)
sb.write(res)
ctx.conn.send_string(sb.str()) or { return false }
//sb.free()
s := sb.str()
defer {
s.free()
}
ctx.conn.send_string(s) or { return false }
return true
}