From: <dat...@us...> - 2006-08-10 23:58:27
|
Revision: 16691 Author: datallah Date: 2006-08-10 16:58:24 -0700 (Thu, 10 Aug 2006) ViewCVS: http://svn.sourceforge.net/gaim/?rev=16691&view=rev Log Message: ----------- Fix CID 220 and plug some more leaks. Modified Paths: -------------- trunk/src/protocols/simple/simple.c Modified: trunk/src/protocols/simple/simple.c =================================================================== --- trunk/src/protocols/simple/simple.c 2006-08-10 23:42:17 UTC (rev 16690) +++ trunk/src/protocols/simple/simple.c 2006-08-10 23:58:24 UTC (rev 16691) @@ -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; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |