net-ads-search crashes when tokengroups attribute is requested

Isaac Boukris iboukris at
Tue Jan 23 18:16:31 UTC 2018

On Tue, Jan 23, 2018 at 9:51 AM, Isaac Boukris <iboukris at> wrote:
> On Tue, Jan 23, 2018 at 3:10 AM, Jeremy Allison <jra at> wrote:
>> Oh, here is the real problem. ads_do_search_retry_internal()
>> is destroying the ADS_STRUCT *ads struct on reconnection
>> error when it didn't open it.
>> Here is an attached (untested) patch you could try. I'll
>> have to go through all the code paths to ensure that this
>> doesn't cause leaks in other areas though.
> Yes, this patch works ok, solves the crash and invalid memory access
> (I had it initially, but wasn't sure).

Here is valgrind memory check before the patch:

And after:


More information about the samba-technical mailing list