openldap: Fix plugin shutdown with connection failed
authorPavel Rochnyack <pavel2000@ngs.ru>
Mon, 24 Jul 2017 08:07:16 +0000 (15:07 +0700)
committerPavel Rochnyack <pavel2000@ngs.ru>
Tue, 25 Jul 2017 13:19:45 +0000 (20:19 +0700)
commitee2af3ba8ed42f5f04962f56edb59b80eb545f77
tree947ad43d6562f83c458dc1f95953c620ac373071
parentd1d1a799a4dd0818877d6d5c1e6c2884c84373ce
openldap: Fix plugin shutdown with connection failed

When plugin failes to connect to LDAP server, the `ldap_unbind_ext_s(st->ld)` is called.
According to `man 3 ldap_unbind_ext_s`, that call is used to free the resources contained in the ld structure.
When plugin shutdown, the `ldap_unbind_ext_s` called again, which causes coredump.

The plugin code was changed to set st->ld to NULL after `ldap_unbind_ext_s()` call.
src/openldap.c