[Ffmpeg-devel] [PATCH] http.c: http_connect() memleak

Rich Felker dalias
Wed Jul 19 17:31:45 CEST 2006


On Wed, Jul 19, 2006 at 09:51:28AM +0100, M?ns Rullg?rd wrote:
> 
> I. Po said:
> > Hi,
> >
> > On 7/18/06, Herv? W. <H.O.W.aka.V+ffmpeg at gmail.com> wrote:
> >> > > patch ok if you use av_freep() and drop the NULL check
> >> > As I know, null-free is safe only from C99, but corrected the patch.
> >> av_freep() calls av_free() which checks for NULL for you.
> >
> > I checked, there is no NULL check. There is ZERO check, but C-standart
> > tell as that they are not equal.
> 
> Great.  Now we can have a discussion about the terms "null pointer", "null
> pointer constant", and "NULL".
> 
> A constant expression evaluating to 0 is a null pointer pointer constant,
> as is the macro NULL.  A comparison between a null pointer and zero,
> explicitly or implicitly, has a non-zero value.

Specifically the value of 1 as opposed to just any nonzero value.

> The code is correct.

Moreover a null pointer will always be all-zero-bits anyway on any
system that can run ffmpeg. Somehow I don't think processing
multimedia works very well with 7bit or 9bit bytes or other such
nonsense of legacy mainframes, at least without radical alterrations
in code that would ruin performance.

Rich





More information about the ffmpeg-devel mailing list