about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorDavid Hill <dhill@conformal.com>2013-04-20 19:34:54 -0400
committerDavid Hill <dhill@conformal.com>2013-04-20 19:34:54 -0400
commit0ebe4f016d493a751d12187b20eca1736d22e812 (patch)
tree2dea5c15de76721b0b660b876b42f1764fc92410
parent6ffebe11f4eb34bb2edce4e330009fc54482371e (diff)
downloadxombrero-0ebe4f016d493a751d12187b20eca1736d22e812.tar.gz
plug memleak if SOUP_URI_VALID_FOR_HTTP fails.
-rw-r--r--settings.c6
-rw-r--r--whitelist.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/settings.c b/settings.c
index a43a117..0437577 100644
--- a/settings.c
+++ b/settings.c
@@ -597,8 +597,12 @@ set_http_proxy(char *proxy)
 	}
 
 	uri = soup_uri_new(proxy);
-	if (uri == NULL || !SOUP_URI_VALID_FOR_HTTP(uri))
+	if (uri == NULL)
+		return (1);
+	if (!SOUP_URI_VALID_FOR_HTTP(uri)) {
+		soup_uri_free(uri);
 		return (1);
+	}
 
 	setup_proxy(proxy);
 
diff --git a/whitelist.c b/whitelist.c
index 47ca9d7..f9862f3 100644
--- a/whitelist.c
+++ b/whitelist.c
@@ -33,8 +33,12 @@ find_domain(const gchar *s, int flags)
 
 	uri = soup_uri_new(s);
 
-	if (uri == NULL || !SOUP_URI_VALID_FOR_HTTP(uri))
+	if (uri == NULL)
 		return (NULL);
+	if (!SOUP_URI_VALID_FOR_HTTP(uri)) {
+		soup_uri_free(uri);
+		return (NULL);
+	}
 
 	if (flags & XT_WL_TOPLEVEL &&
 	    !isdigit(uri->host[strlen(uri->host) - 1]))