Re: Out-of-memory error reports in libpq - Mailing list pgsql-hackers

From Ranier Vilela
Subject Re: Out-of-memory error reports in libpq
Date
Msg-id CAEudQAp8V=pHFDutvgPTFmEqac3YZTVT_RfsqBcuprpcMTa+WQ@mail.gmail.com
Whole thread Raw
In response to Re: Out-of-memory error reports in libpq  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Em qui., 29 de jul. de 2021 às 00:40, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
Ranier Vilela <ranier.vf@gmail.com> writes:
> IMO, I think that "char *msg" is unnecessary, isn't it?

> + if (!PQExpBufferBroken(errorMessage))
> + res->errMsg = pqResultStrdup(res, errorMessage->data);
>   else
> - res->errMsg = NULL;
> + res->errMsg = libpq_gettext("out of memory\n");

Please read the comment.
You're right, I missed pqResultStrdup fail.

+1

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Dilip Kumar
Date:
Subject: Re: [Patch] ALTER SYSTEM READ ONLY
Next
From: Ranier Vilela
Date:
Subject: Re: Out-of-memory error reports in libpq