cherry pick from upstream: https://github.com/civetweb/civetweb/pull/630/files
Leak is easy to reproduce by: echo leak | nc localhost 8088
cherry pick from upstream: https://github.com/civetweb/civetweb/pull/630/files
Leak is easy to reproduce by: echo leak | nc localhost 8088