# HG changeset patch # User Daniel Atallah # Date 1155254304 0 # Node ID 72660065eb3e3144914f973e5b89076c96e65356 # Parent d594f0466585120c11f6f3f70640c62c7f221b39 [gaim-migrate @ 16691] Fix CID 220 and plug some more leaks. committer: Tailor Script diff -r d594f0466585 -r 72660065eb3e src/protocols/simple/simple.c --- 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;