diff options
author | Jeremy Linton <jeremy.linton@arm.com> | 2017-04-19 12:24:52 -0500 |
---|---|---|
committer | Daniel Wagner <wagi@monom.org> | 2017-04-24 22:15:13 +0200 |
commit | 765d8500657f295abf9a521582a3951f8f6fad66 (patch) | |
tree | 41c5ad7ef323dc55360245d22abd635a4849707a | |
parent | 1a4b4b18371f4ee4e266e55779db68094e938398 (diff) | |
download | pacrunner-765d8500657f295abf9a521582a3951f8f6fad66.tar.gz |
proxy: Fix unclean shutdown with proxy_disable
The proxy disable code calls set_proxy and clears the context
structure, which results in the mosjs_clear_proxy not being
called. Also there is a memory leak in the glist due to use of
remove_link() rather than remove(). The former simply removes the
entry from the linked list but doesn't free it.
-rw-r--r-- | src/proxy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/proxy.c b/src/proxy.c index 7579887..e233e1d 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -444,9 +444,10 @@ int pacrunner_proxy_disable(struct pacrunner_proxy *proxy) pthread_mutex_lock(&proxy_mutex); proxy_list = g_list_remove_link(proxy_list, list); + g_list_free(list); pthread_mutex_unlock(&proxy_mutex); - __pacrunner_js_set_proxy(NULL); + __pacrunner_js_clear_proxy(proxy); pacrunner_proxy_unref(proxy); |