Mercurial > pidgin.yaz
comparison libpurple/protocols/simple/simple.c @ 18574:94f4048f1380
Fix from Will Hawkins to plug some leaks in error cases for the SIMPLE prpl. References #2181.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 20 Jul 2007 16:31:39 +0000 |
parents | 16bdcffb1c62 |
children | 941965d6fd88 315151da0dc6 |
comparison
equal
deleted
inserted
replaced
18567:44e07aa8386a | 18574:94f4048f1380 |
---|---|
974 xmlnode *state; | 974 xmlnode *state; |
975 gchar *statedata; | 975 gchar *statedata; |
976 | 976 |
977 if(!isc) { | 977 if(!isc) { |
978 purple_debug_info("simple", "process_incoming_message: can not parse iscomposing\n"); | 978 purple_debug_info("simple", "process_incoming_message: can not parse iscomposing\n"); |
979 g_free(from); | |
979 return; | 980 return; |
980 } | 981 } |
981 | 982 |
982 state = xmlnode_get_child(isc, "state"); | 983 state = xmlnode_get_child(isc, "state"); |
983 | 984 |
984 if(!state) { | 985 if(!state) { |
985 purple_debug_info("simple", "process_incoming_message: no state found\n"); | 986 purple_debug_info("simple", "process_incoming_message: no state found\n"); |
986 xmlnode_free(isc); | 987 xmlnode_free(isc); |
988 g_free(from); | |
987 return; | 989 return; |
988 } | 990 } |
989 | 991 |
990 statedata = xmlnode_get_data(state); | 992 statedata = xmlnode_get_data(state); |
991 if(statedata) { | 993 if(statedata) { |
1061 | 1063 |
1062 pidf = xmlnode_from_str(msg->body, msg->bodylen); | 1064 pidf = xmlnode_from_str(msg->body, msg->bodylen); |
1063 | 1065 |
1064 if(!pidf) { | 1066 if(!pidf) { |
1065 purple_debug_info("simple", "process_incoming_notify: no parseable pidf\n"); | 1067 purple_debug_info("simple", "process_incoming_notify: no parseable pidf\n"); |
1068 g_free(from); | |
1066 return; | 1069 return; |
1067 } | 1070 } |
1068 | 1071 |
1069 if ((tuple = xmlnode_get_child(pidf, "tuple"))) | 1072 if ((tuple = xmlnode_get_child(pidf, "tuple"))) |
1070 if ((status = xmlnode_get_child(tuple, "status"))) | 1073 if ((status = xmlnode_get_child(tuple, "status"))) |
1071 basicstatus = xmlnode_get_child(status, "basic"); | 1074 basicstatus = xmlnode_get_child(status, "basic"); |
1072 | 1075 |
1073 if(!basicstatus) { | 1076 if(!basicstatus) { |
1074 purple_debug_info("simple", "process_incoming_notify: no basic found\n"); | 1077 purple_debug_info("simple", "process_incoming_notify: no basic found\n"); |
1075 xmlnode_free(pidf); | 1078 xmlnode_free(pidf); |
1079 g_free(from); | |
1076 return; | 1080 return; |
1077 } | 1081 } |
1078 | 1082 |
1079 tmp2 = xmlnode_get_data(basicstatus); | 1083 tmp2 = xmlnode_get_data(basicstatus); |
1080 | 1084 |
1081 if(!tmp2) { | 1085 if(!tmp2) { |
1082 purple_debug_info("simple", "process_incoming_notify: no basic data found\n"); | 1086 purple_debug_info("simple", "process_incoming_notify: no basic data found\n"); |
1083 xmlnode_free(pidf); | 1087 xmlnode_free(pidf); |
1088 g_free(from); | |
1084 return; | 1089 return; |
1085 } | 1090 } |
1086 | 1091 |
1087 if(strstr(tmp2, "open")) { | 1092 if(strstr(tmp2, "open")) { |
1088 isonline = TRUE; | 1093 isonline = TRUE; |