summaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2011-09-20 11:06:00 +0200
committerportix <portix@gmx.net>2011-09-20 11:06:00 +0200
commitf3980991ef0157b4a29f40916b0a50008fba4944 (patch)
tree7ba13b232610a0781c53b0ea8f00d9d7e2ecd356 /src/session.c
parent8f558e520ca7ebb3576187ffa357301aab064a3a (diff)
downloaddwb-f3980991ef0157b4a29f40916b0a50008fba4944.zip
In session.c: uninitialized value
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/session.c b/src/session.c
index 1a2a85d4..4bd0a258 100644
--- a/src/session.c
+++ b/src/session.c
@@ -101,16 +101,17 @@ session_restore(const char *name) {
if (line[0] && line[1] && line[2]) {
int current = strtol(line[0], NULL, 10);
if (current <= last) {
- view_add(NULL, false);
- web = CURRENT_WEBVIEW();
+ web = WEBVIEW(view_add(NULL, false));
bf_list = webkit_web_back_forward_list_new_with_web_view(web);
if (lastweb) {
session_load_webview(lastweb, uri, last);
}
lastweb = web;
}
- WebKitWebHistoryItem *item = webkit_web_history_item_new_with_data(line[1], line[2]);
- webkit_web_back_forward_list_add_item(bf_list, item);
+ if (bf_list != NULL) {
+ WebKitWebHistoryItem *item = webkit_web_history_item_new_with_data(line[1], line[2]);
+ webkit_web_back_forward_list_add_item(bf_list, item);
+ }
last = current;
FREE(uri);
uri = g_strdup(line[1]);
@@ -134,6 +135,7 @@ session_restore(const char *name) {
dwb_unfocus();
dwb_focus(dwb.state.views);
dwb_update_layout(false);
+ FREE(uri);
return true;
}/*}}}*/