From d2c29dbe955ab220a11076fe128a2a41b3d48869 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 29 Jul 2009 18:51:35 +0000 Subject: Keep a copy of the next_fetcher pointer to avoid a situation where the fetch gets freed during the poll routine and the next pointer can no longer be read. svn path=/trunk/netsurf/; revision=8898 --- content/fetch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content/fetch.c') diff --git a/content/fetch.c b/content/fetch.c index f9414172b..71c7bda65 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -493,6 +493,7 @@ void fetch_free(struct fetch *f) void fetch_poll(void) { scheme_fetcher *fetcher = fetchers; + struct fetch *next_fetcher; fetch_dispatch_jobs(); @@ -500,8 +501,9 @@ void fetch_poll(void) return; /* No point polling, there's no fetch active. */ while (fetcher != NULL) { /* LOG(("Polling fetcher for %s", fetcher->scheme_name)); */ + next_fetcher = fetcher->next_fetcher; fetcher->poll_fetcher(fetcher->scheme_name); - fetcher = fetcher->next_fetcher; + fetcher = next_fetcher; } } -- cgit v1.2.3