pidgin/pidgin

08b79a9a0ad2
Parents b3c69b679399
Children 793a6c2732d0
Fix some issues scanbuild found in the simple protocol plugin

Testing Done:
Verified scanbuild no longer detected the errors.

Reviewed at https://reviews.imfreedom.org/r/704/
--- a/libpurple/protocols/simple/simple.c Tue Jun 01 20:21:04 2021 -0500
+++ b/libpurple/protocols/simple/simple.c Tue Jun 01 20:21:29 2021 -0500
@@ -1803,6 +1803,7 @@
static void simple_udp_host_resolved(GSList *hosts, gpointer data, const char *error_message) {
struct simple_account_data *sip = (struct simple_account_data*) data;
int addr_size;
+ gpointer hosts_data;
sip->query_data = NULL;
@@ -1816,12 +1817,14 @@
addr_size = GPOINTER_TO_INT(hosts->data);
hosts = g_slist_remove(hosts, hosts->data);
memcpy(&(sip->serveraddr), hosts->data, addr_size);
- g_free(hosts->data);
+ hosts_data = hosts->data;
hosts = g_slist_remove(hosts, hosts->data);
+ g_free(hosts_data);
while(hosts) {
hosts = g_slist_remove(hosts, hosts->data);
- g_free(hosts->data);
+ hosts_data = hosts->data;
hosts = g_slist_remove(hosts, hosts->data);
+ g_free(hosts_data);
}
/* create socket for incoming connections */