Mercurial > pidgin
diff libpurple/protocols/msn/object.c @ 20991:c8f99cb61dc9
Cleanup some unnecessary NULL checks in g_strdup()/g_free().
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 19 Oct 2007 01:38:35 +0000 |
parents | 44b4e8bd759b |
children | b65997110933 |
line wrap: on
line diff
--- a/libpurple/protocols/msn/object.c Fri Oct 19 01:28:55 2007 +0000 +++ b/libpurple/protocols/msn/object.c Fri Oct 19 01:38:35 2007 +0000 @@ -154,10 +154,8 @@ { g_return_if_fail(obj != NULL); - if (obj->creator != NULL) - g_free(obj->creator); - - obj->creator = (creator == NULL ? NULL : g_strdup(creator)); + g_free(obj->creator); + obj->creator = g_strdup(creator); } void @@ -181,10 +179,8 @@ { g_return_if_fail(obj != NULL); - if (obj->location != NULL) - g_free(obj->location); - - obj->location = (location == NULL ? NULL : g_strdup(location)); + g_free(obj->location); + obj->location = g_strdup(location); } void @@ -192,10 +188,8 @@ { g_return_if_fail(obj != NULL); - if (obj->friendly != NULL) - g_free(obj->friendly); - - obj->friendly = (friendly == NULL ? NULL : g_strdup(friendly)); + g_free(obj->friendly); + obj->friendly = g_strdup(friendly); } void @@ -203,10 +197,8 @@ { g_return_if_fail(obj != NULL); - if (obj->sha1d != NULL) - g_free(obj->sha1d); - - obj->sha1d = (sha1d == NULL ? NULL : g_strdup(sha1d)); + g_free(obj->sha1d); + obj->sha1d = g_strdup(sha1d); } void @@ -214,10 +206,8 @@ { g_return_if_fail(obj != NULL); - if (obj->sha1c != NULL) - g_free(obj->sha1c); - - obj->sha1c = (sha1c == NULL ? NULL : g_strdup(sha1c)); + g_free(obj->sha1c); + obj->sha1c = g_strdup(sha1c); } const char *