--- libsoap-1.1.0.orig/nanohttp/nanohttp-request.c
+++ libsoap-1.1.0/nanohttp/nanohttp-request.c
@@ -311,6 +311,7 @@
     }
     else
     {
+      http_input_stream_free(req->in);
       req->attachments = mimeMessage;
       req->in =
         http_input_stream_new_from_file(mimeMessage->root_part->filename);
