[PATCH] LDB: Redudant test on NULL context remove

Petr Cech pcech at redhat.com
Tue Apr 19 06:15:51 UTC 2016


On 04/18/2016 05:27 PM, Simo wrote:
> On Thu, 2016-03-31 at 10:38 +0200, Volker Lendecke wrote:
>> 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.h
>>> tml
>>>
>>> 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.
>
> Patch looks good to me.
> I think it is ok to keep the check on ldb != NULL, to avoid busywork.
>
> Reviwed-by: Simo Sorce <idra at samba.org>
>
> Can a second team member add their reviewed-by ?
>
> Simo.
>

Thanks Simo for review.

There is patch with signed-off-by flag.

Regards

-- 
Petr^4 Čech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-LDB-Redudant-test-on-NULL-context-remove.patch
Type: text/x-patch
Size: 1097 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20160419/e25f16f6/0001-LDB-Redudant-test-on-NULL-context-remove.bin>


More information about the samba-technical mailing list