This should clean up leaked memory.
Signed-off-by: Martin Storsjö <martin@martin.st>
return ret;
}
+static int applehttp_close(URLContext *h)
+{
+ AppleHTTPContext *s = h->priv_data;
+
+ free_segment_list(s);
+ free_variant_list(s);
+ ffurl_close(s->seg_hd);
+ av_free(s);
+ return 0;
+}
+
static int applehttp_open(URLContext *h, const char *uri, int flags)
{
AppleHTTPContext *s;
return 0;
fail:
- av_free(s);
+ applehttp_close(h);
return ret;
}
goto start;
}
-static int applehttp_close(URLContext *h)
-{
- AppleHTTPContext *s = h->priv_data;
-
- free_segment_list(s);
- free_variant_list(s);
- ffurl_close(s->seg_hd);
- av_free(s);
- return 0;
-}
-
URLProtocol ff_applehttp_protocol = {
.name = "applehttp",
.url_open = applehttp_open,