aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-22 11:52:22 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-02-12 17:11:55 +0100
commit5262c88bb0778caf9e553a03cc887f985a336d8d (patch)
tree21b5df53e2d106ac09e25f5dc2f15fcc379ee21b
parentbd78b9416d54fe0b3f4a69907420c7fa3ebc4ff8 (diff)
downloadffmpeg-5262c88bb0778caf9e553a03cc887f985a336d8d.tar.gz
avformat/rtmpproto: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/rtmpproto.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index ebc1628855..3d7cdaab2d 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -217,9 +217,8 @@ static void free_tracked_methods(RTMPContext *rt)
int i;
for (i = 0; i < rt->nb_tracked_methods; i ++)
- av_free(rt->tracked_methods[i].name);
- av_free(rt->tracked_methods);
- rt->tracked_methods = NULL;
+ av_freep(&rt->tracked_methods[i].name);
+ av_freep(&rt->tracked_methods);
rt->tracked_methods_size = 0;
rt->nb_tracked_methods = 0;
}
@@ -2552,7 +2551,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt)
// Increase the size by the injected packet
rt->flv_size += 55;
// Delete the old FLV data
- av_free(old_flv_data);
+ av_freep(&old_flv_data);
p = rt->flv_data + 13;
bytestream_put_byte(&p, FLV_TAG_TYPE_META);