From 108954273a89264569d0be808895e3ce442893ee Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 9 Dec 2008 00:25:59 +0100 Subject: [PATCH] Don't pass NULL to soup_uri_new and free the proxy string properly --- midori/main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/midori/main.c b/midori/main.c index 32cea376..e6b5956d 100644 --- a/midori/main.c +++ b/midori/main.c @@ -1441,6 +1441,7 @@ soup_session_constructed_cb (GObject* object) MidoriApp* app; MidoriWebSettings* settings; SoupSession* session; + gchar* http_proxy; SoupURI* proxy_uri; if (old_session_constructed_cb) @@ -1448,7 +1449,10 @@ soup_session_constructed_cb (GObject* object) app = g_type_get_qdata (SOUP_TYPE_SESSION, g_quark_from_static_string ("midori-app")); settings = katze_object_get_object (app, "settings"); - proxy_uri = soup_uri_new (katze_object_get_string (settings, "http-proxy")); + http_proxy = katze_object_get_string (settings, "http-proxy"); + /* soup_uri_new expects a non-NULL string */ + proxy_uri = soup_uri_new (http_proxy ? http_proxy : ""); + g_free (http_proxy); g_object_set (object, "user-agent", katze_object_get_string (settings, "ident-string"), "proxy-uri", proxy_uri, -- 2.39.5