Hi!

Kostik wrote:
> 2. I think that in my application has memory leak. 

It seems that here is a memory leaks:

--- ./rfc2047.c.orig    2010-04-12 17:25:22.000000000 +0400
+++ ./rfc2047.c 2010-04-14 14:22:54.065990600 +0400
@@ -176,6 +176,9 @@

          mu_stream_close (filter);
          mu_stream_destroy (&filter, mu_stream_get_owner (filter));
+         mu_stream_close (in_stream);
+         mu_stream_destroy (&in_stream, mu_stream_get_owner (in_stream));

          fromstr = sp + 1;
          run_count = 1;
@@ -186,6 +189,11 @@
            {
              run_count++;
              fromstr++;
+             free (fromcode);
+             free (encoding_type);
+             free (encoded_text);
              continue;
            }
          else
--

It is not working patch because duble free is possible with fromcode,
encoding_type and encoded_text. But it shows the location of possible problems.



And valgrind show about two more leaks:
---
==5922== 160 bytes in 1 blocks are definitely lost in loss record 23 of 26
==5922==    at 0x40237D8: malloc (vg_replace_malloc.c:195)
==5922==    by 0x8066AEF: mu_filter_iconv_create (filter_iconv.c:430)
==5922==    by 0x80593AF: mu_decode_filter (mutil.c:1331)
==5922==    by 0x805EBAE: mu_rfc2047_decode (rfc2047.c:163)
==5922==    by 0x8057051: mu_mimehdr_decode_param (mimehdr.c:430)
==5922==    by 0x805782C: mu_message_aget_decoded_attachment_name
(mimehdr.c:636)

and

==5922== 3,151 (40 direct, 3,111 indirect) bytes in 1 blocks are definitely
lost in loss record 26 of 26
==5922==    at 0x4022BB5: calloc (vg_replace_malloc.c:418)
==5922==    by 0x804EC76: mu_filter_create (filter.c:210)
==5922==    by 0x805934F: mu_decode_filter (mutil.c:1324)
==5922==    by 0x805EBAE: mu_rfc2047_decode (rfc2047.c:163)
==5922==    by 0x8057051: mu_mimehdr_decode_param (mimehdr.c:430)
==5922==    by 0x805782C: mu_message_aget_decoded_attachment_name
(mimehdr.c:636)
---

=kostik

_______________________________________________
Bug-mailutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-mailutils

Reply via email to