Plug some memory leaks in NUT muxer and demuxer

Originally committed as revision 22120 to svn://svn.ffmpeg.org/ffmpeg/trunk
release/0.6
Vitor Sessak 15 years ago
parent fee6faa2b6
commit 27dbc47c05
  1. 4
      libavformat/nutdec.c
  2. 3
      libavformat/nutenc.c

@ -897,9 +897,13 @@ static int read_seek(AVFormatContext *s, int stream_index, int64_t pts, int flag
static int nut_read_close(AVFormatContext *s)
{
NUTContext *nut = s->priv_data;
int i;
av_freep(&nut->time_base);
av_freep(&nut->stream);
av_tree_destroy_free_elem(nut->syncpoints);
for(i = 1; i < nut->header_count; i++)
av_freep(&nut->header[i]);
return 0;
}

@ -797,6 +797,9 @@ static int write_trailer(AVFormatContext *s){
while(nut->header_count<3)
write_headers(nut, bc);
put_flush_packet(bc);
av_freep(&nut->stream);
av_freep(&nut->time_base);
av_tree_destroy_free_elem(nut->syncpoints);
return 0;
}

Loading…
Cancel
Save