Commit 59ca6e25 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/hlsproto: Use av_freep, to avoid leaving stale pointers in memory

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6e70e4ac
...@@ -80,7 +80,7 @@ static void free_segment_list(HLSContext *s) ...@@ -80,7 +80,7 @@ static void free_segment_list(HLSContext *s)
{ {
int i; int i;
for (i = 0; i < s->n_segments; i++) for (i = 0; i < s->n_segments; i++)
av_free(s->segments[i]); av_freep(&s->segments[i]);
av_freep(&s->segments); av_freep(&s->segments);
s->n_segments = 0; s->n_segments = 0;
} }
...@@ -89,7 +89,7 @@ static void free_variant_list(HLSContext *s) ...@@ -89,7 +89,7 @@ static void free_variant_list(HLSContext *s)
{ {
int i; int i;
for (i = 0; i < s->n_variants; i++) for (i = 0; i < s->n_variants; i++)
av_free(s->variants[i]); av_freep(&s->variants[i]);
av_freep(&s->variants); av_freep(&s->variants);
s->n_variants = 0; s->n_variants = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment