[FFmpeg-cvslog] avformat_free_context: favor av_freep()

Michael Niedermayer git at videolan.org
Sat Oct 1 21:38:46 CEST 2011


ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Sat Oct  1 01:29:30 2011 +0200| [4d36f7cf88ccb869c2febb50c6f42d7a722a6d4f] | committer: Michael Niedermayer

avformat_free_context: favor av_freep()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 2a93f28a4b6eef8b93046e0b4e3225f2ff1e7324)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d36f7cf88ccb869c2febb50c6f42d7a722a6d4f
---

 libavformat/utils.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 6f108fb..40f0089 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2659,13 +2659,13 @@ void avformat_free_context(AVFormatContext *s)
             av_free_packet(&st->cur_pkt);
         }
         av_dict_free(&st->metadata);
-        av_free(st->index_entries);
-        av_free(st->codec->extradata);
-        av_free(st->codec->subtitle_header);
-        av_free(st->codec);
-        av_free(st->priv_data);
-        av_free(st->info);
-        av_free(st);
+        av_freep(&st->index_entries);
+        av_freep(&st->codec->extradata);
+        av_freep(&st->codec->subtitle_header);
+        av_freep(&st->codec);
+        av_freep(&st->priv_data);
+        av_freep(&st->info);
+        av_freep(&st);
     }
     for(i=s->nb_programs-1; i>=0; i--) {
         av_dict_free(&s->programs[i]->metadata);
@@ -2676,7 +2676,7 @@ void avformat_free_context(AVFormatContext *s)
     av_freep(&s->priv_data);
     while(s->nb_chapters--) {
         av_dict_free(&s->chapters[s->nb_chapters]->metadata);
-        av_free(s->chapters[s->nb_chapters]);
+        av_freep(&s->chapters[s->nb_chapters]);
     }
     av_freep(&s->chapters);
     av_dict_free(&s->metadata);



More information about the ffmpeg-cvslog mailing list