diff options
author | Christophe Dumez <christophe.dumez@intel.com> | 2011-06-06 16:55:04 +0300 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2011-06-07 10:53:08 +0200 |
commit | 46db6a3212e60e3754f645e136bf0824438c047d (patch) | |
tree | d40e4d1a168e2e4034f85deb3025891cf993d885 | |
parent | a178de88aae840d0fede477e2585be346f2b43e4 (diff) | |
download | evolution-data-server-46db6a3212e60e3754f645e136bf0824438c047d.tar.gz |
e_contact_name_from_string(): Fix possible memory leak
The 'name' variable memory was leaked when name_str
is NULL.
(cherry picked from commit 6f17fe55e43d366eebd7f0bc7eeba0f3c56b3785)
-rw-r--r-- | addressbook/libebook/e-contact.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c index c6127d23d..13b378e58 100644 --- a/addressbook/libebook/e-contact.c +++ b/addressbook/libebook/e-contact.c @@ -1743,11 +1743,12 @@ e_contact_name_to_string (const EContactName *name) EContactName* e_contact_name_from_string (const gchar *name_str) { - EContactName *name = e_contact_name_new (); + EContactName *name; ENameWestern *western; g_return_val_if_fail (name_str != NULL, NULL); + name = e_contact_name_new (); western = e_name_western_parse (name_str ? name_str : ""); name->prefixes = g_strdup (western->prefix); |