krb5_free_data

Simo Sorce simo at redhat.com
Sat Jun 21 13:27:58 EDT 2014


On Sat, 2014-06-21 at 17:56 +0100, Markus Moeller wrote:
> Hi,
> 
>    I wonder if it wouldn't be  better to check if val->data is NULL before 
> freeing ?

No, it would be useless, free(NULL); is ok, it is just a no-op.

Simo.

>   To me the function makes otherwise no sense as I have to do the 
> same checks myself before  I can call the function safely.
> 
> 
> void KRB5_CALLCONV
> krb5_free_data(krb5_context context, krb5_data *val)
> {
>     if (val == NULL)
>         return;
>     free(val->data);
>     free(val);
> }
> 
> 
> Thank you
> Markus 
> 
> 
> _______________________________________________
> krbdev mailing list             krbdev at mit.edu
> https://mailman.mit.edu/mailman/listinfo/krbdev


-- 
Simo Sorce * Red Hat, Inc * New York



More information about the krbdev mailing list