Re: freeing LDAPMessage in CheckLDAPAuth

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: freeing LDAPMessage in CheckLDAPAuth
Дата
Msg-id YxQ6RgYc3GzV9ndd@paquier.xyz
обсуждение исходный текст
Ответ на freeing LDAPMessage in CheckLDAPAuth  (Zhihong Yu <zyu@yugabyte.com>)
Ответы Re: freeing LDAPMessage in CheckLDAPAuth  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Sep 03, 2022 at 05:00:30PM -0700, Zhihong Yu wrote:
>        Note  that  *res*  parameter  of  *ldap*_*search*_*ext*_*s()*
> and *ldap*_*search*_*s()*
>        should be freed with *ldap*_*msgfree()* regardless of return
> value of these
>        functions.
>
> Please see the attached patch which frees the search_message in the above case.

Yep, nice catch, I am reading the same thing as you do.  I can see
that we already do that after a failing ldap_search_st() call in
fe-connect.c for libpq.  Hence, similarly, we'd better call
ldap_msgfree() on search_message when it is not NULL after a search
failure, no?  The patch you are proposing does not do that.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_basebackup's --gzip switch misbehaves
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: json docs fix jsonb_path_exists_tz again