[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-dev] Remove NULL checks for *_free() calls



On Sun, 30 Aug 2015 23:24:07 +0000, Michael McConville wrote:
> Mansour Moufid wrote:
> > Michael McConville wrote:
...
> > >   error:
> > > -  if (x509) {
> > > -    X509_free(x509);
> > > -    x509 = NULL;
> > > -  }
...
> > But you did find some places they forgot to assign NULL after free.
> 
> For one reason or another, this isn't common practice.

It's not my practise, at least. I would definitely not use the
x509=NULL part when the end of the function is nigh (and doesn't
do anything with x509), and for me the =NULL is almost an indication
that x509 is used somehow lateron.

Also, if there were an x509=obj->x509 previously the correct thing
would be an obj->x509=NULL.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev