aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Barrucadu <mike@barrucadu.co.uk>2009-05-04 09:00:26 +0100
committerGravatar Barrucadu <mike@barrucadu.co.uk>2009-05-04 09:00:26 +0100
commit390f12bc918c8e5b4054a0475493197088848660 (patch)
treef3d83f4b98da7df2bcd3922cd872d576a5f740d8
parentb6a39ed3eba72d2c3fea3ae9ed28ff7510a05e1f (diff)
Fixed GLib errors / possible segfault in networking options loading.
-rw-r--r--uzbl.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/uzbl.c b/uzbl.c
index 8e25903..dce8bba 100644
--- a/uzbl.c
+++ b/uzbl.c
@@ -894,7 +894,7 @@ settings_init () {
if (config_file) {
config = g_key_file_new ();
res = g_key_file_load_from_file (config, config_file, G_KEY_FILE_NONE, NULL);
- if(res) {
+ if (res) {
printf ("Config %s loaded\n", config_file);
} else {
fprintf (stderr, "Config %s loading failed\n", config_file);
@@ -962,11 +962,13 @@ settings_init () {
}
/* networking options */
- proxy_url = g_key_file_get_value (config, "network", "proxy_server", NULL);
- http_debug = g_key_file_get_integer (config, "network", "http_debug", NULL);
- useragent = g_key_file_get_value (config, "network", "user-agent", NULL);
- max_conns = g_key_file_get_integer (config, "network", "max_conns", NULL);
- max_conns_host = g_key_file_get_integer (config, "network", "max_conns_per_host", NULL);
+ if (res) {
+ proxy_url = g_key_file_get_value (config, "network", "proxy_server", NULL);
+ http_debug = g_key_file_get_integer (config, "network", "http_debug", NULL);
+ useragent = g_key_file_get_value (config, "network", "user-agent", NULL);
+ max_conns = g_key_file_get_integer (config, "network", "max_conns", NULL);
+ max_conns_host = g_key_file_get_integer (config, "network", "max_conns_per_host", NULL);
+ }
if(proxy_url){
g_object_set(G_OBJECT(soup_session), SOUP_SESSION_PROXY_URI, soup_uri_new(proxy_url), NULL);