Mercurial > pidgin
diff src/value.c @ 14035:8bda65b88e49
[gaim-migrate @ 16638]
A bunch of small changes. Mostly remove "if not null" checks before
calling g_free, g_list_free, g_slist_free and g_strdup. Also use
g_list_foreach() to call g_free to free strings in an array. And
some whitespace changes here and there.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 05 Aug 2006 08:27:39 +0000 |
parents | fde4101fa183 |
children |
line wrap: on
line diff
--- a/src/value.c Sat Aug 05 05:42:28 2006 +0000 +++ b/src/value.c Sat Aug 05 08:27:39 2006 +0000 @@ -85,13 +85,11 @@ if (gaim_value_get_type(value) == GAIM_TYPE_BOXED) { - if (value->u.specific_type != NULL) - g_free(value->u.specific_type); + g_free(value->u.specific_type); } else if (gaim_value_get_type(value) == GAIM_TYPE_STRING) { - if (value->data.string_data != NULL) - g_free(value->data.string_data); + g_free(value->data.string_data); } g_free(value); @@ -322,10 +320,8 @@ { g_return_if_fail(value != NULL); - if (value->data.string_data != NULL) - g_free(value->data.string_data); - - value->data.string_data = (data == NULL ? NULL : g_strdup(data)); + g_free(value->data.string_data); + value->data.string_data = g_strdup(data); } void