[PATCH] LDB: Redudant test on NULL context remove

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Mar 31 08:38:30 UTC 2016


On Thu, Mar 31, 2016 at 08:27:28AM +0200, Petr Cech wrote:
> For clarity:
> 
> original mail is
> https://lists.samba.org/archive/samba-technical/2016-March/113068.html
> 
> the main idea is
> 
> "There is redudant test on NULL context in ldb_dn_new_fmt() function.
> We use this (NULL) context in talloc_vasprintf() function which is
> able to work with NULL at all. And at the end, we free this newly
> created (by talloc_vasprintf) context. So it should be safe to remove
> this check."

If you follow that path fully, even the !ldb check is redundant.
ldb_dn_new will deal with ldb==NULL fine and return NULL.

By the way, our convention is to add a signed-off-by (git commit -s)
flag to patches. Can you do that?

You might also internally contact Simo Sorce. He has put in those
checks ages ago, maybe he has some comments on your patches.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list