Re: [gmime-devel] g_mime_multipart_encrypted_decrypt & memory mgmt



Hi Dirk,

You should be unreffing the GMimeDecryptResult. The fact that there was still a leak after doing so was a bug in GMime which I have now fixed in git master. I also found a bug in g_mime_multipart_encrypted_decrypt() in cases where the 'result' out param was passed as null, so I fixed that too.

Now all I need to do is figure out how to get my gmime test suite copied into my Linux VirtualBox from my backups so that I can make a release.

Jeff

On 9/12/2012 4:54 AM, Dirk-Jan C. Binnema wrote:
Hi all,

I'm using
     g_mime_multipart_encrypted_decrypt
but I can't get rid of a 48-byte memleak; valgrind tells me:

==26529== 922 (48 direct, 874 indirect) bytes in 1 blocks are definitely lost in loss record 133 of 148
==26529==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==26529==    by 0x36B244D26E: g_malloc (gmem.c:159)
==26529==    by 0x36B2461671: g_slice_alloc (gslice.c:1003)
==26529==    by 0x36B2461BC5: g_slice_alloc0 (gslice.c:1029)
==26529==    by 0x36B302F96F: g_type_create_instance (gtype.c:1872)
==26529==    by 0x36B30147A7: g_object_constructor (gobject.c:1849)
==26529==    by 0x36B3016260: g_object_newv (gobject.c:1632)
==26529==    by 0x36C943FD94: gpg_decrypt (gmime-gpg-context.c:2030)
==26529==    by 0x36C9425DF6: g_mime_multipart_encrypted_decrypt (gmime-multipart-encrypted.c:370)

I am freeing the GMimeObject* that g_mime_multipart_encrypted_decrypt
returns, but it seems that some memory gets lost somewhere, related to
the GMimeDecryptResult (which is an out param, the third arg to
g_mime_multipart_encrypted_decrypt).

I tried to unref this GMimeDecryptResult myself, but to that seems only
to increase the leak:

==29710== 242 (208 direct, 34 indirect) bytes in 2 blocks are definitely lost in loss record 112 of 142
==29710==    at 0x4A0884D: malloc (vg_replace_malloc.c:263)
==29710==    by 0x36B244D26E: g_malloc (gmem.c:159)
==29710==    by 0x36B2461671: g_slice_alloc (gslice.c:1003)
==29710==    by 0x36B2461BC5: g_slice_alloc0 (gslice.c:1029)
==29710==    by 0x36B302F96F: g_type_create_instance (gtype.c:1872)
==29710==    by 0x36B30147A7: g_object_constructor (gobject.c:1849)
==29710==    by 0x36B3016260: g_object_newv (gobject.c:1632)
==29710==    by 0x36C943F2F4: gpg_ctx_op_step (gmime-gpg-context.c:1297)
==29710==    by 0x36C943FD58: gpg_decrypt (gmime-gpg-context.c:2011)
==29710==    by 0x36C9425DF6: g_mime_multipart_encrypted_decrypt (gmime-multipart-encrypted.c:370)

(the gpg_ctx_op_step calls g_mime_certificate_new)

I'm probably doing something wrong, any hint what that could be is
welcome :)

Note, I'm on Fedora 17 (x86_64), using the Fedora-provided GMime 2.6.9.

Thanks,
Dirk.

--
Dirk-Jan C. Binnema                  Helsinki, Finland
e:djcb djcbsoftware nl           w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C
_______________________________________________
gmime-devel-list mailing list
gmime-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gmime-devel-list




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