[Ffmpeg-devel] [RFC] av_free() vs. av_freep()

Rich Felker dalias
Sun Jul 23 19:52:45 CEST 2006


On Sat, Jul 22, 2006 at 01:18:14PM +0200, Reimar D?ffinger wrote:
> Hello,
> On Sat, Jul 22, 2006 at 11:07:55AM +0200, Michael Niedermayer wrote:
> > maybe we should replace all av_free() by av_freep() and drop av_free()
> > entirely? it would make mistakly using freed memory alot more noticable
> 
> I completely agree unless there are some occasions where it makes the code more
> complicated (I don't think there will be any though).

IMO it shouldn't happen -- using the address after the memory is freed
is almost always a mistake, unless you're doing something like
1. free memory
2. search through array of pointers and delete any other references.
however i don't see any compelling reason not to do that in the other
order, or any reason for ffmpeg to do that at all..

rich





More information about the ffmpeg-devel mailing list