* mu-contacts: fix leak in contact_info_new

This commit is contained in:
Dirk-Jan C. Binnema 2011-05-24 23:21:51 +03:00
parent d2fa1c3596
commit 03c94bd82d
1 changed files with 6 additions and 6 deletions

View File

@ -394,7 +394,8 @@ clear_str (char* str)
g_strstrip (str);
}
/* note, we will *own* the name we get */
/* note, we will *own* the name, email we get, and we'll free them in
* the end... */
static ContactInfo *
contact_info_new (char *email, char *name, time_t tstamp)
{
@ -405,14 +406,13 @@ contact_info_new (char *email, char *name, time_t tstamp)
cinfo = g_slice_new (ContactInfo);
/* we need to clear the strings from control chars because
* they could screw up the keyfile */
clear_str (email);
clear_str (name);
/* we need to clear the strings from control chars because
* they could screw up the keyfile */
cinfo->_email = g_strdup (email);
cinfo->_name = name ? g_strdup (name) : NULL;
cinfo->_email = email;
cinfo->_name = name;
cinfo->_tstamp = tstamp;
return cinfo;