Re: freeing LDAPMessage in CheckLDAPAuth

From: Zhihong Yu <zyu(at)yugabyte(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: freeing LDAPMessage in CheckLDAPAuth
Date: 2022-09-04 13:52:37
Message-ID: CALNJ-vR=MLc5XnrSp1JOM0B2+YyS8OseP9zZ-R7SHc8_85P5NQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 4, 2022 at 3:58 AM Zhihong Yu <zyu(at)yugabyte(dot)com> wrote:

>
>
> On Sun, Sep 4, 2022 at 12:25 AM Michael Paquier <michael(at)paquier(dot)xyz>
> wrote:
>
>> On Sun, Sep 04, 2022 at 01:52:10AM -0400, Tom Lane wrote:
>> > I can't get too excited about this. All of the error exit paths in
>> > backend authentication code will lead immediately to process exit, so
>> > the possibility of some memory being leaked really has no consequences
>> > worth worrying about. If we *were* worried about it, sprinkling a few
>> > more ldap_msgfree() calls into the existing code would hardly make it
>> > more bulletproof.
>>
>> Even if this is not critical in the backend for this authentication
>> path, I'd like to think that it is still a good practice for future
>> code so as anything code-pasted around would get the call. So I see
>> no reason to not put smth on HEAD at least.
>>
> Hi,
> Here is updated patch as you suggested in your previous email.
>
> Thanks
>
Hi,
Please take a look at patch v3.

Thanks

Attachment Content-Type Size
v3-ldap-msg-free.patch application/octet-stream 711 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-09-04 13:56:59 Re: failing to build preproc.c on solaris with sun studio
Previous Message Andrew Dunstan 2022-09-04 13:46:31 Re: failing to build preproc.c on solaris with sun studio