diff options
-rw-r--r-- | content/content.c | 7 | ||||
-rw-r--r-- | desktop/browser.c | 10 | ||||
-rw-r--r-- | render/html.c | 7 |
3 files changed, 21 insertions, 3 deletions
diff --git a/content/content.c b/content/content.c index 9310eb180..19bb45b0a 100644 --- a/content/content.c +++ b/content/content.c @@ -931,6 +931,13 @@ void content_reset(struct content *c) c->size = 0; talloc_free(c->mime_type); c->mime_type = 0; + talloc_free(c->refresh); + c->refresh = 0; + talloc_free(c->title); + c->title = 0; + talloc_free(c->source_data); + c->source_data = 0; + c->source_size = c->source_allocated = 0; } diff --git a/desktop/browser.c b/desktop/browser.c index 27fcd6ad1..ee3e7eed5 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -648,8 +648,14 @@ void browser_window_refresh(void *p) struct browser_window *bw = p; bool history_add = true; - assert(bw->current_content->status == CONTENT_STATUS_READY || - bw->current_content->status == CONTENT_STATUS_DONE); + assert(bw->current_content && + (bw->current_content->status == CONTENT_STATUS_READY || + bw->current_content->status == CONTENT_STATUS_DONE)); + + /* Ignore if the refresh URL has gone + * (may happen if a fetch error occurred) */ + if (!bw->current_content->refresh) + return; /* mark this content as invalid so it gets flushed from the cache */ bw->current_content->fresh = false; diff --git a/render/html.c b/render/html.c index 0c55bd805..b51510d3d 100644 --- a/render/html.c +++ b/render/html.c @@ -1563,7 +1563,12 @@ void html_object_refresh(void *p) { struct content *c = (struct content *)p; - assert(c->type == CONTENT_HTML && c->refresh); + assert(c->type == CONTENT_HTML); + + /* Ignore if refresh URL has gone + * (may happen if fetch errored) */ + if (!c->refresh) + return; c->fresh = false; |