@jangko thx ! but, However, although I am freeing up the memory, when request
coming shorter than the previous request, the character of the previous request
is added at the end of the short request.
However, if call alloc0 instead, the problem is gone
for example,
GET /foo HTTP1.1\13\10
next req,
GET / HTTP1.11\13\10
# ↑↑↑
# GET /foo HTTP1.1\13\10
sometimes, adding garbage char such as unicode which a previous request does
not have.
This was confirmed with the debug code here:
[mofuw#L65](https://github.com/2vg/mofuw/blob/master/mofuw.nim#L65)
Since libuv calls the callback to store the buffer when storing the request, we
are securing the memory here:
[mofuw#L49](https://github.com/2vg/mofuw/blob/master/mofuw.nim#L49)
memory is released with one of the following:
when req is end,
[mofuw#L70](https://github.com/2vg/mofuw/blob/master/mofuw.nim#L70)
when some error,
[mofuw#L74](https://github.com/2vg/mofuw/blob/master/mofuw.nim#L74)
when parse error, (my parser returns a negative value on error.)
[mofuw#L95](https://github.com/2vg/mofuw/blob/master/mofuw.nim#L95)
and, after callback end,
[mofuw#L108](https://github.com/2vg/mofuw/blob/master/mofuw.nim#L108)
although memory leak does not occur even if high load is applied, but why is
unexpected character added when alloc0() is not used ... ;;