Package: libnanohttp1 Version: 1.1.0-9 Severity: important Tags: patch I've been developing a server that does SOAP with Attachments using libnanohttp1 and libcsoap1. I used valgrind to check for memory leaks and found that every time I sent a SOAP message with an attachment, it leaked some memory. After some investigating I found that there is a memory leak in nanohttp/nanohttp-request.c when the request contains a MIME attachment. In hrequest_new_from_socket(), req->in is set by http_input_stream_new() which allocates memory. Later on in the function req->in is set by http_input_stream_new_from_file() without free()'ing the contents of req->in first. I've attached a patch which fixes the problem.
Here's the valgrind leak summary that shows the leaked memory: ==23097== 1,752 bytes in 6 blocks are definitely lost in loss record 8 of 8 ==23097== at 0x401D38B: malloc (vg_replace_malloc.c:149) ==23097== by 0x403AF08: http_input_stream_new (in /usr/lib/libnanohttp.so.1.1.0) ==23097== by 0x403CC9D: hrequest_new_from_socket (in /usr/lib/libnanohttp.so.1.1.0) ==23097== by 0x40399B1: (within /usr/lib/libnanohttp.so.1.1.0) ==23097== by 0x40C223F: start_thread (in /lib/tls/i686/cmov/libpthread-2.3.6.so) ==23097== by 0x419A4AD: clone (in /lib/tls/i686/cmov/libc-2.3.6.so) After applying my patch, rebuilding & reinstalling the debs, recompiling my application and testing it with valgrind, there were no more memory leaks. Please apply this patch. I've sent a copy to the two upstream maintainers listed in the AUTHORS file. The e-mail to Ferhat Ayaz bounced :( -- Tom Cort Systems Developer Vermont Department of Taxes
libcsoap-1.1.0-memory-leak.patch
Description: libcsoap-1.1.0-memory-leak.patch