safe_free or if(x) free(x)

Simo Sorce idra at
Sat Sep 15 03:08:01 GMT 2001

Nice, idea, send a patch and we will look at placing it.
the if .. free() lines generlly are there because they have not been (yet)
changed to the safe_free function.
There's a lot of old code in samba ;-)

On Fri, Sep 14, 2001 at 10:02:24PM +0200, andreas moroder wrote:
> Hello,
> I counted 193 occurences of safe_free in the source files but i counted also 
> more then hundred lines of code where I found a 'if' and a free() statement 
> in the same line.
> Is there a reason that both variants are used ?
> Wouldn't it be more efficient to rewite safe_free as a macro, like the 
> dlinklist macros ?
> Bye 
> Andreas

Simo Sorce       idra at
Samba Team

More information about the samba-technical mailing list