summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/handlers/html/html_script.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/content/handlers/html/html_script.c b/content/handlers/html/html_script.c
index 203dc5089..2a72d512e 100644
--- a/content/handlers/html/html_script.c
+++ b/content/handlers/html/html_script.c
@@ -96,6 +96,11 @@ nserror html_script_exec(html_content *c, bool allow_defer)
s->data.handle, &size );
script_handler(c->jscontext, data, size,
nsurl_access(hlcache_handle_get_url(s->data.handle)));
+ /* We have to re-acquire this here since the
+ * c->scripts array may have been reallocated
+ * as a result of executing this script.
+ */
+ s = &(c->scripts[i]);
s->already_started = true;