diff options
-rw-r--r-- | content/fetchers/data.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/content/fetchers/data.c b/content/fetchers/data.c index 802b4f15e..68f59a792 100644 --- a/content/fetchers/data.c +++ b/content/fetchers/data.c @@ -86,13 +86,14 @@ static void *fetch_data_setup(struct fetch *parent_fetch, nsurl *url, return NULL; ctx->parent_fetch = parent_fetch; + /* TODO: keep as nsurl to avoid copy */ - ctx->url = strdup(nsurl_access(url)); - + ctx->url = malloc(nsurl_length(url) + 1); if (ctx->url == NULL) { free(ctx); return NULL; } + memcpy(ctx->url, nsurl_access(url), nsurl_length(url) + 1); RING_INSERT(ring, ctx); |