pidgin/pidgin

Fix some issues scanbuild found in proxy.c
release-2.x.y
2021-06-01, Gary Kramlich
793a6c2732d0
Parents 08b79a9a0ad2
Children 3e498730f8ca
Fix some issues scanbuild found in proxy.c

Testing Done:
Verified scanbuild no longer detected the errors.

Reviewed at https://reviews.imfreedom.org/r/705/
--- a/libpurple/proxy.c Tue Jun 01 20:21:29 2021 -0500
+++ b/libpurple/proxy.c Tue Jun 01 20:22:06 2021 -0500
@@ -579,11 +579,14 @@
while (connect_data->hosts != NULL)
{
+ gpointer data;
+
/* Discard the length... */
connect_data->hosts = g_slist_remove(connect_data->hosts, connect_data->hosts->data);
/* Free the address... */
- g_free(connect_data->hosts->data);
+ data = connect_data->hosts->data;
connect_data->hosts = g_slist_remove(connect_data->hosts, connect_data->hosts->data);
+ g_free(data);
}
g_free(connect_data->host);
@@ -2061,7 +2064,6 @@
return;
}
- i = 0;
buf[0] = 0x05; /* SOCKS version 5 */
if (purple_proxy_info_get_username(connect_data->gpi) != NULL) {