From 25440a07c3b421134b4376d7db3ee4b7ed57ad98 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Mon, 12 Jul 2021 08:38:02 -0500 Subject: Avoid direct use of libproxy Since hexchat already depends on GLib, it's better to use GProxyResolver instead. This might use libproxy, or not, as appropriate. P.S. This removes a memory safety issue because proxy_list is allocated using malloc(), not g_malloc(), and therefore using g_strfreev() is incorrect. The proper way to free the proxy list returned by libproxy is to use px_proxy_factory_free_proxies() (but nobody does that because it was added in libproxy 0.4.16, which is somewhat recent). --- src/common/hexchat.c | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'src/common/hexchat.c') diff --git a/src/common/hexchat.c b/src/common/hexchat.c index 8702c63d..3ba7ed6d 100644 --- a/src/common/hexchat.c +++ b/src/common/hexchat.c @@ -57,10 +57,6 @@ #include /* for g_type_init() */ #endif -#ifdef USE_LIBPROXY -#include -#endif - GSList *popup_list = 0; GSList *button_list = 0; GSList *dlgbutton_list = 0; @@ -111,10 +107,6 @@ struct session *current_tab; struct session *current_sess = 0; struct hexchatprefs prefs; -#ifdef USE_LIBPROXY -pxProxyFactory *libproxy_factory; -#endif - /* * Update the priority queue of the "interesting sessions" * (sess_list_by_lastact). @@ -1102,10 +1094,6 @@ main (int argc, char *argv[]) hexchat_remote (); #endif -#ifdef USE_LIBPROXY - libproxy_factory = px_proxy_factory_new (); -#endif - #ifdef WIN32 coinit_result = CoInitializeEx (NULL, COINIT_APARTMENTTHREADED); if (SUCCEEDED (coinit_result)) @@ -1148,10 +1136,6 @@ main (int argc, char *argv[]) } #endif -#ifdef USE_LIBPROXY - px_proxy_factory_free (libproxy_factory); -#endif - #ifdef WIN32 WSACleanup (); #endif -- cgit 1.4.1