Mercurial > pidgin.yaz
comparison libgaim/protocols/jabber/parser.c @ 14623:86e1ebd8ee7f
[gaim-migrate @ 17352]
Avoid allocating, duping and deallocating.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 26 Sep 2006 00:28:02 +0000 |
parents | 218a36c1c9e2 |
children | 58202142e9ad |
comparison
equal
deleted
inserted
replaced
14622:f8beee12ade9 | 14623:86e1ebd8ee7f |
---|---|
49 attrib[attrib_len] = '\0'; | 49 attrib[attrib_len] = '\0'; |
50 | 50 |
51 if(!strcmp(attributes[i], "version") | 51 if(!strcmp(attributes[i], "version") |
52 && !strcmp(attrib, "1.0")) { | 52 && !strcmp(attrib, "1.0")) { |
53 js->protocol_version = JABBER_PROTO_1_0; | 53 js->protocol_version = JABBER_PROTO_1_0; |
54 g_free(attrib); | |
54 } else if(!strcmp(attributes[i], "id")) { | 55 } else if(!strcmp(attributes[i], "id")) { |
55 if(js->stream_id) | 56 if(js->stream_id) |
56 g_free(js->stream_id); | 57 g_free(js->stream_id); |
57 js->stream_id = g_strdup(attrib); | 58 js->stream_id = attrib; |
58 } | 59 } |
59 g_free(attrib); | |
60 } | 60 } |
61 if(js->protocol_version == JABBER_PROTO_0_9) | 61 if(js->protocol_version == JABBER_PROTO_0_9) |
62 js->auth_type = JABBER_AUTH_IQ_AUTH; | 62 js->auth_type = JABBER_AUTH_IQ_AUTH; |
63 | 63 |
64 if(js->state == JABBER_STREAM_INITIALIZING) | 64 if(js->state == JABBER_STREAM_INITIALIZING) |