ldap: fix resource leak

Поиск
Список
Период
Сортировка
От Neil Conway
Тема ldap: fix resource leak
Дата
Msg-id 1162687417.5692.319.camel@localhost.localdomain
обсуждение исходный текст
Ответы Re: ldap: fix resource leak
Список pgsql-patches
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
Дата:
Сообщение: WIP patch for tuple freezing issues
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ldap: fix resource leak