On Thu, Sep 24, 2026 at 3:39 PM Steven Niu <niushiji@gmail.com> wrote:
>
> Hi, Peter,
>
> I have two comments for V6 patch:
Thanks for your review!
>
> 1. In function describeOneSchemaDetails(), res gets assigned by PSQLexec(),
> if res is NULL, code flow goes to error_return label where termPQExpBuffer(&title) is called.
>
> However, the title is NOT initialized at all in this case.
> Suggest to initialize the title right after the initialization of buf.
Fixed as suggested.
>
> 2. Also in function describeOneSchemaDetails(), res gets assigned by PSQLexec();
>
> res = PSQLexec(buf.data);
>
> If the PQclear() is successful, we will go inside the Footer processing,
> if pset.sversion >= 150000 and following PSQLexec() fails,
>
> result = PSQLexec(buf.data);
> if (!result)
> goto error_return;
>
> code flow goes to error_return label. But there is no PQclear(res), and I think it may cause memory leak;
> Suggest to initialize the res to be NULL and add PQclear(res) in error_return branch.
>
Fixed as suggested.
~
PSA patch v7.
======
Kind Regards,
Peter Smith.
Fujitsu Australia