ldap: fix resource leak

Поиск
Список
Период
Сортировка
Искать
От
Neil Conway
Тема
ldap: fix resource leak
Дата
Msg-id
1162687417.5692.319.camel@localhost.localdomain
Список
Дерево обсуждения
ldap: fix resource leak Neil Conway <neilc@samurai.com>
Re: ldap: fix resource leak Tom Lane <tgl@sss.pgh.pa.us>
Re: ldap: fix resource leak Neil Conway <neilc@samurai.com>
Re: ldap: fix resource leak Tom Lane <tgl@sss.pgh.pa.us>
Re: ldap: fix resource leak Tom Lane <tgl@sss.pgh.pa.us>
Re: ldap: fix resource leak Neil Conway <neilc@samurai.com>
Attached is a patch that fixes a minor error in CheckLDAPAuth() in 8.2:
when an LDAP handle is obtained via ldap_init(), it needs to be released
via ldap_unbind(). The code did this, but only if an error did not
occur.

I fixed this by adding the appropriate ldap_unbind() calls in error
control paths. An alternative would be to have a single place do the
error handling, and jump to that via goto. Anyone have any strong
feelings about which style is preferable here? I also didn't bother
checking the return value of ldap_unbind().

I also made a minor stylistic fix (use a "bool" for a boolean variable,
not an int).

Barring any objections, I'll apply this to HEAD tomorrow.

-Neil

В списке pgsql-patches по дате отправления
От: Tom Lane
Дата:
От: Tom Lane
Дата:
Сообщение: Re: ldap: fix resource leak
FAQ