bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] seems mailutils memory leaks


From: Kostik
Subject: [bug-mailutils] seems mailutils memory leaks
Date: Wed, 14 Apr 2010 14:35:48 +0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]