Got Segmentation fault (double free or corruption (!prev):) trying to free http request object if both http client and http server run on the same machine. Does not matter if server and client running in single process or different.
After some debugging and googling found http://stackoverflow.com/questions/2902064/how-to-track-down-a-double-free-or-corruption-error-in-c-with-gdb So I guess httpRequest object in sever and client internally use the same memory segments, and if server free httpRequest early then client, client try to unset already destructed object. But this is just my guess. If client does not free httpRequest we get uncontrolled memory usage. To show this, run test script.