1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vweb: fix a leak

This commit is contained in:
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('\r\n')
sb.write(headers_close) sb.write(headers_close)
sb.write(res) sb.write(res)
ctx.conn.send_string(sb.str()) or { return false } s := sb.str()
//sb.free() defer {
s.free()
}
ctx.conn.send_string(s) or { return false }
return true return true
} }