GNOME Bugzilla – Bug 771289
Memory leaks in test-contact-types.c
Last modified: 2017-01-20 14:03:19 UTC
Created attachment 335360 [details] [review] patch
Review of attachment 335360 [details] [review]: Thanks for a bug report and patch, but: a) the g_autofree doesn't guarantee the variable to be freed (it's not portable) b) you did not initialize the variables, which is a requirement for using g_autofree c) the structures are not meant to be freed by g_free(), but by e_contact_photo_free() It also means that you caused a memory leak of the internal structure members, which is also the 'data' variable returned by g_base64_decode(). Do not use g_autofree and make it explicit what is freed, where it's freed and how it's freed. It makes code better, than hiding things under some not-everywhere supported compiler toys.
I found out that there had been more memory leaks than this one, thus I fixed them all (according to valgrind). Created commit 3d136bd in eds master (3.23.90+)