Mercurial > pidgin.yaz
changeset 13693:510b7b7dd645
[gaim-migrate @ 16096]
Part of SF Patch #1437836 from Sadrul
'3. replace a bunch of "if (a) free(a);" with "free(a);"'
My comment in the patch:
"I'm accepting this, even though it doesn't really do much. In the future, however, I would suggest avoiding creating these type of changes unless you're already editing the code directly around them."
committer: Tailor Script <tailor@pidgin.im>
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Tue, 25 Apr 2006 17:38:43 +0000 |
parents | ea77ce998dc7 |
children | 0d45a2495c7e |
files | src/protocols/msn/session.c src/protocols/msn/switchboard.c src/protocols/msn/user.c |
diffstat | 3 files changed, 16 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/msn/session.c Tue Apr 25 17:27:17 2006 +0000 +++ b/src/protocols/msn/session.c Tue Apr 25 17:38:43 2006 +0000 @@ -70,17 +70,10 @@ msn_userlist_destroy(session->userlist); - if (session->passport_info.kv != NULL) - g_free(session->passport_info.kv); - - if (session->passport_info.sid != NULL) - g_free(session->passport_info.sid); - - if (session->passport_info.mspauth != NULL) - g_free(session->passport_info.mspauth); - - if (session->passport_info.client_ip != NULL) - g_free(session->passport_info.client_ip); + g_free(session->passport_info.kv); + g_free(session->passport_info.sid); + g_free(session->passport_info.mspauth); + g_free(session->passport_info.client_ip); if (session->passport_info.file != NULL) {
--- a/src/protocols/msn/switchboard.c Tue Apr 25 17:27:17 2006 +0000 +++ b/src/protocols/msn/switchboard.c Tue Apr 25 17:38:43 2006 +0000 @@ -104,14 +104,9 @@ while ((l = swboard->ack_list) != NULL) msg_error_helper(swboard->cmdproc, l->data, MSN_MSG_ERROR_SB); - if (swboard->im_user != NULL) - g_free(swboard->im_user); - - if (swboard->auth_key != NULL) - g_free(swboard->auth_key); - - if (swboard->session_id != NULL) - g_free(swboard->session_id); + g_free(swboard->im_user); + g_free(swboard->auth_key); + g_free(swboard->session_id); for (l = swboard->users; l != NULL; l = l->next) g_free(l->data);
--- a/src/protocols/msn/user.c Tue Apr 25 17:27:17 2006 +0000 +++ b/src/protocols/msn/user.c Tue Apr 25 17:38:43 2006 +0000 @@ -64,23 +64,12 @@ if (user->msnobj != NULL) msn_object_destroy(user->msnobj); - if (user->passport != NULL) - g_free(user->passport); - - if (user->friendly_name != NULL) - g_free(user->friendly_name); - - if (user->store_name != NULL) - g_free(user->store_name); - - if (user->phone.home != NULL) - g_free(user->phone.home); - - if (user->phone.work != NULL) - g_free(user->phone.work); - - if (user->phone.mobile != NULL) - g_free(user->phone.mobile); + g_free(user->passport); + g_free(user->friendly_name); + g_free(user->store_name); + g_free(user->phone.home); + g_free(user->phone.work); + g_free(user->phone.mobile); g_free(user); } @@ -134,9 +123,7 @@ { g_return_if_fail(user != NULL); - if (user->passport != NULL) - g_free(user->passport); - + g_free(user->passport); user->passport = g_strdup(passport); } @@ -145,9 +132,7 @@ { g_return_if_fail(user != NULL); - if (user->friendly_name != NULL) - g_free(user->friendly_name); - + g_free(user->friendly_name); user->friendly_name = g_strdup(name); } @@ -156,9 +141,7 @@ { g_return_if_fail(user != NULL); - if (user->store_name != NULL) - g_free(user->store_name); - + g_free(user->store_name); user->store_name = g_strdup(name); }