Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Ranier Vilela
Em seg., 27 de mai. de 2024 às 14:42, Daniel Gustafsson escreveu: > > On 27 May 2024, at 18:47, Jelte Fennema-Nio wrote: > > > So overall I agree pqReleaseConnHost and release_conn_addrinfo can be > > improved for easier safe usage in the future, but I don't think those > > improvements should b

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Daniel Gustafsson
> On 27 May 2024, at 18:47, Jelte Fennema-Nio wrote: > So overall I agree pqReleaseConnHost and release_conn_addrinfo can be > improved for easier safe usage in the future, but I don't think those > improvements should be grouped into the same commit with an actual > bugfix. I have pushed the fi

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Ranier Vilela
Em seg., 27 de mai. de 2024 às 13:47, Jelte Fennema-Nio escreveu: > On Mon, 27 May 2024 at 18:16, Ranier Vilela wrote: > > Is it mandatory to call PQcancelFinish in case PQcancelCreate fails? > > > Yes, see the following line in the docs: > > Note that when PQcancelCreate returns a non-null poin

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Jelte Fennema-Nio
On Mon, 27 May 2024 at 18:16, Ranier Vilela wrote: > Is it mandatory to call PQcancelFinish in case PQcancelCreate fails? Yes, see the following line in the docs: Note that when PQcancelCreate returns a non-null pointer, you must call PQcancelFinish when you are finished with it, in order to di

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Ranier Vilela
Em seg., 27 de mai. de 2024 às 12:40, Jelte Fennema-Nio escreveu: > On Mon, 27 May 2024 at 16:06, Ranier Vilela wrote: > > Em seg., 27 de mai. de 2024 às 10:23, Daniel Gustafsson > escreveu: > >> > On 27 May 2024, at 14:25, Ranier Vilela wrote: > >> > I think that commit 61461a3, left some ove

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Jelte Fennema-Nio
On Mon, 27 May 2024 at 16:06, Ranier Vilela wrote: > Em seg., 27 de mai. de 2024 às 10:23, Daniel Gustafsson > escreveu: >> > On 27 May 2024, at 14:25, Ranier Vilela wrote: >> > I think that commit 61461a3, left some oversight. >> > The function *PQcancelCreate* fails in check, >> > return of *

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Ranier Vilela
Hi Daniel, Em seg., 27 de mai. de 2024 às 10:23, Daniel Gustafsson escreveu: > > On 27 May 2024, at 14:25, Ranier Vilela wrote: > > > I think that commit 61461a3, left some oversight. > > The function *PQcancelCreate* fails in check, > > return of *calloc* function. > > > > Trivial fix is attac

Re: Fix calloc check if oom (PQcancelCreate)

2024-05-27 Thread Daniel Gustafsson
> On 27 May 2024, at 14:25, Ranier Vilela wrote: > I think that commit 61461a3, left some oversight. > The function *PQcancelCreate* fails in check, > return of *calloc* function. > > Trivial fix is attached. Agreed, this looks like a copy/paste from the calloc calls a few lines up. > But, IMO