safe_free patch

Simo Sorce idra at
Mon Sep 17 04:51:12 GMT 2001

Thank you very much for your idea andreas.
I've just put a slightly different SAFE_FREE into HEAD and
changed all the safe_free() and free() code.

On Sun, Sep 16, 2001 at 05:09:40PM +0200, andreas moroder wrote:
> Last week I asked why free() and safe_free() is utilized.
> Simo told me that this happens because there is old and new code and if I 
> want I can send in a patch.
> Here it is.
> I changed most occurences of free AND safe_free  to SAFE_FREE
> this not only check if the pointer is != NULL before the free, the macro also 
> sets the pointer to NULL.
> The code becomes also more readable.
> There are few places ( nt_printing etc. ) where I did not change safe_free to 
> SAFE_FREE because the call is in a for ( ,,) statement.
> I compressed the patch because it is too big uncompressed.
> Bye
> Andreas

Simo Sorce       idra at
Samba Team

More information about the samba-technical mailing list