GNOME Bugzilla – Bug 651436
Possible memory leak in e_contact_name_from_string()
Last modified: 2011-06-07 09:00:29 UTC
Created attachment 188861 [details] [review] Proposed patch The 'name' variable memory gets leaked when name_str is NULL. See attached patch.
Yep, that's valid. In general, allocating memory in a function before checking arguments is a bug. Commit to master and backport as far back as you need to.
Created attachment 189326 [details] [review] Patch for master Here is an adapted version of the patch that applied to master. The previous patch was meant for 2.32 and did not apply directly because of a formatting change in the code.
Chris backported the fixes and I committed them to 2.32 and 3.0 branches: 6cabbd8201ed15d656b4bf6568e56473e636bcae e_contact_name_from_string(): Fix possible memory leak 46db6a3212e60e3754f645e136bf0824438c047d e_contact_name_from_string(): Fix possible memory leak