Mercurial > pidgin
comparison src/proxy.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 | 6fc412e59214 |
children | 10e8eb6a4910 |
comparison
equal
deleted
inserted
replaced
14034:0839a7b71325 | 14035:8bda65b88e49 |
---|---|
105 gaim_proxy_info_set_host(GaimProxyInfo *info, const char *host) | 105 gaim_proxy_info_set_host(GaimProxyInfo *info, const char *host) |
106 { | 106 { |
107 g_return_if_fail(info != NULL); | 107 g_return_if_fail(info != NULL); |
108 | 108 |
109 g_free(info->host); | 109 g_free(info->host); |
110 | 110 info->host = g_strdup(host); |
111 info->host = (host == NULL ? NULL : g_strdup(host)); | |
112 } | 111 } |
113 | 112 |
114 void | 113 void |
115 gaim_proxy_info_set_port(GaimProxyInfo *info, int port) | 114 gaim_proxy_info_set_port(GaimProxyInfo *info, int port) |
116 { | 115 { |
123 gaim_proxy_info_set_username(GaimProxyInfo *info, const char *username) | 122 gaim_proxy_info_set_username(GaimProxyInfo *info, const char *username) |
124 { | 123 { |
125 g_return_if_fail(info != NULL); | 124 g_return_if_fail(info != NULL); |
126 | 125 |
127 g_free(info->username); | 126 g_free(info->username); |
128 | 127 info->username = g_strdup(username); |
129 info->username = (username == NULL ? NULL : g_strdup(username)); | |
130 } | 128 } |
131 | 129 |
132 void | 130 void |
133 gaim_proxy_info_set_password(GaimProxyInfo *info, const char *password) | 131 gaim_proxy_info_set_password(GaimProxyInfo *info, const char *password) |
134 { | 132 { |
135 g_return_if_fail(info != NULL); | 133 g_return_if_fail(info != NULL); |
136 | 134 |
137 g_free(info->password); | 135 g_free(info->password); |
138 | 136 info->password = g_strdup(password); |
139 info->password = (password == NULL ? NULL : g_strdup(password)); | |
140 } | 137 } |
141 | 138 |
142 GaimProxyType | 139 GaimProxyType |
143 gaim_proxy_info_get_type(const GaimProxyInfo *info) | 140 gaim_proxy_info_get_type(const GaimProxyInfo *info) |
144 { | 141 { |