Mercurial > pidgin.yaz
comparison libpurple/protocols/msn/httpconn.c @ 20935:1d9d5de48b9e
Fix some leaks.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 15 Oct 2007 00:31:34 +0000 |
parents | 3972d9b3ca2f |
children | 2c039a40babc |
comparison
equal
deleted
inserted
replaced
20934:6739d93f95c1 | 20935:1d9d5de48b9e |
---|---|
167 #endif | 167 #endif |
168 | 168 |
169 /* Now we should be able to process the data. */ | 169 /* Now we should be able to process the data. */ |
170 if ((s = purple_strcasestr(header, "X-MSN-Messenger: ")) != NULL) | 170 if ((s = purple_strcasestr(header, "X-MSN-Messenger: ")) != NULL) |
171 { | 171 { |
172 char *full_session_id, *gw_ip, *session_action; | 172 gchar *full_session_id = NULL, *gw_ip = NULL, *session_action = NULL; |
173 char *t, *session_id; | 173 char *t, *session_id; |
174 char **elems, **cur, **tokens; | 174 char **elems, **cur, **tokens; |
175 | 175 |
176 full_session_id = gw_ip = session_action = NULL; | 176 full_session_id = gw_ip = session_action = NULL; |
177 | 177 |
194 | 194 |
195 for (cur = elems; *cur != NULL; cur++) | 195 for (cur = elems; *cur != NULL; cur++) |
196 { | 196 { |
197 tokens = g_strsplit(*cur, "=", 2); | 197 tokens = g_strsplit(*cur, "=", 2); |
198 | 198 |
199 if (strcmp(tokens[0], "SessionID") == 0) | 199 if (strcmp(tokens[0], "SessionID") == 0) { |
200 g_free(full_session_id); | |
200 full_session_id = tokens[1]; | 201 full_session_id = tokens[1]; |
201 else if (strcmp(tokens[0], "GW-IP") == 0) | 202 } else if (strcmp(tokens[0], "GW-IP") == 0) { |
203 g_free(gw_ip); | |
202 gw_ip = tokens[1]; | 204 gw_ip = tokens[1]; |
203 else if (strcmp(tokens[0], "Session") == 0) | 205 } else if (strcmp(tokens[0], "Session") == 0) { |
206 g_free(session_action); | |
204 session_action = tokens[1]; | 207 session_action = tokens[1]; |
205 else | 208 } else |
206 g_free(tokens[1]); | 209 g_free(tokens[1]); |
207 | 210 |
208 g_free(tokens[0]); | 211 g_free(tokens[0]); |
209 /* Don't free each of the tokens, only the array. */ | 212 /* Don't free each of the tokens, only the array. */ |
210 g_free(tokens); | 213 g_free(tokens); |