Mercurial > pidgin.yaz
changeset 14070:72660065eb3e
[gaim-migrate @ 16691]
Fix CID 220 and plug some more leaks.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 10 Aug 2006 23:58:24 +0000 |
parents | d594f0466585 |
children | 1e084a6e7446 |
files | src/protocols/simple/simple.c |
diffstat | 1 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/simple/simple.c Thu Aug 10 23:42:17 2006 +0000 +++ b/src/protocols/simple/simple.c Thu Aug 10 23:58:24 2006 +0000 @@ -967,6 +967,7 @@ if(!state) { gaim_debug_info("simple", "process_incoming_message: no state found\n"); + xmlnode_free(isc); return; } @@ -1035,7 +1036,7 @@ gchar *fromhdr; gchar *tmp2; xmlnode *pidf; - xmlnode *basicstatus; + xmlnode *basicstatus = NULL, *tuple, *status; gboolean isonline = FALSE; fromhdr = sipmsg_find_header(msg, "From"); @@ -1049,10 +1050,13 @@ return; } - basicstatus = xmlnode_get_child(xmlnode_get_child(xmlnode_get_child(pidf, "tuple"), "status"), "basic"); + if ((tuple = xmlnode_get_child(pidf, "tuple"))) + if ((status = xmlnode_get_child(tuple, "status"))) + basicstatus = xmlnode_get_child(status, "basic"); if(!basicstatus) { gaim_debug_info("simple", "process_incoming_notify: no basic found\n"); + xmlnode_free(pidf); return; } @@ -1060,6 +1064,7 @@ if(!tmp2) { gaim_debug_info("simple", "process_incoming_notify: no basic data found\n"); + xmlnode_free(pidf); return; } @@ -1211,15 +1216,15 @@ } if(acceptheader) { gchar *tmp = acceptheader; - int foundpidf = 0; - int foundxpidf = 0; + gboolean foundpidf = FALSE; + gboolean foundxpidf = FALSE; while(tmp && tmp < acceptheader + strlen(acceptheader)) { gchar *tmp2 = strchr(tmp, ','); if(tmp2) *tmp2 = '\0'; if(!strcmp("application/pidf+xml", tmp)) - foundpidf = 1; + foundpidf = TRUE; if(!strcmp("application/xpidf+xml", tmp)) - foundxpidf = 1; + foundxpidf = TRUE; if(tmp2) { *tmp2 = ','; tmp = tmp2;