summaryrefslogtreecommitdiff
path: root/content/fetchcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'content/fetchcache.c')
-rw-r--r--content/fetchcache.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/content/fetchcache.c b/content/fetchcache.c
index 28c098034..63bd5be35 100644
--- a/content/fetchcache.c
+++ b/content/fetchcache.c
@@ -147,8 +147,12 @@ void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size)
/* redirect URLs must be absolute by HTTP/1.1, but many sites send
* relative ones: treat them as relative to requested URL */
url = url_join(data, c->url);
- content_broadcast(c, CONTENT_MSG_REDIRECT, url);
- xfree(url);
+ if (url) {
+ content_broadcast(c, CONTENT_MSG_REDIRECT, url);
+ xfree(url);
+ } else {
+ content_broadcast(c, CONTENT_MSG_ERROR, "Bad redirect");
+ }
if (c->cache)
cache_destroy(c);
content_destroy(c);