Re: Plug minor memleak in pg_dump

2022-02-10 Thread Ranier Vilela
Em qui., 10 de fev. de 2022 às 10:57, Daniel Gustafsson escreveu: > > On 10 Feb 2022, at 12:14, Ranier Vilela wrote: > > Em qua., 9 de fev. de 2022 às 23:16, Michael Paquier < > mich...@paquier.xyz > escreveu: > > > This patch makes things worse, doesn't it? > > No.

Re: Plug minor memleak in pg_dump

2022-02-10 Thread Daniel Gustafsson
> On 10 Feb 2022, at 12:14, Ranier Vilela wrote: > Em qua., 9 de fev. de 2022 às 23:16, Michael Paquier > escreveu: > This patch makes things worse, doesn't it? > No. > > Doesn't this localized > change mean that we expose ourselves more into *ignoring* TOC

Re: Plug minor memleak in pg_dump

2022-02-10 Thread Ranier Vilela
Em qui., 10 de fev. de 2022 às 08:14, Ranier Vilela escreveu: > Em qua., 9 de fev. de 2022 às 23:16, Michael Paquier > escreveu: > >> On Wed, Feb 09, 2022 at 02:48:35PM -0300, Ranier Vilela wrote: >> > IMO I think that still have troubles here. >> > >> > ReadStr can return NULL, so the fix can

Re: Plug minor memleak in pg_dump

2022-02-10 Thread Ranier Vilela
Em qua., 9 de fev. de 2022 às 23:16, Michael Paquier escreveu: > On Wed, Feb 09, 2022 at 02:48:35PM -0300, Ranier Vilela wrote: > > IMO I think that still have troubles here. > > > > ReadStr can return NULL, so the fix can crash. > > - sscanf(tmp, "%u", >catalogId.tableoid); > -

Re: Plug minor memleak in pg_dump

2022-02-09 Thread Michael Paquier
On Wed, Feb 09, 2022 at 02:48:35PM -0300, Ranier Vilela wrote: > IMO I think that still have troubles here. > > ReadStr can return NULL, so the fix can crash. - sscanf(tmp, "%u", >catalogId.tableoid); - free(tmp); + if (tmp) + { + sscanf(tmp,

Re: Plug minor memleak in pg_dump

2022-02-09 Thread Ranier Vilela
>No, but I was distracted by other things leaving this on the TODO list. It's >been pushed now. Hi, IMO I think that still have troubles here. ReadStr can return NULL, so the fix can crash. regards, Ranier Vilela v1_fix_possible_null_dereference_pg_backup_archiver.patch Description: Binary

Re: Plug minor memleak in pg_dump

2022-02-09 Thread Daniel Gustafsson
> On 9 Feb 2022, at 03:56, Michael Paquier wrote: > > On Wed, Feb 02, 2022 at 10:06:13AM +0100, Daniel Gustafsson wrote: >> The leak itself is clearly not something to worry about wrt memory pressure. >> We do read into tmp and free it in other places in the same function though >> (as >> you

Re: Plug minor memleak in pg_dump

2022-02-08 Thread Bharath Rupireddy
On Wed, Feb 9, 2022 at 8:26 AM Michael Paquier wrote: > > On Wed, Feb 02, 2022 at 10:06:13AM +0100, Daniel Gustafsson wrote: > > The leak itself is clearly not something to worry about wrt memory pressure. > > We do read into tmp and free it in other places in the same function though > > (as >

Re: Plug minor memleak in pg_dump

2022-02-08 Thread Michael Paquier
On Wed, Feb 02, 2022 at 10:06:13AM +0100, Daniel Gustafsson wrote: > The leak itself is clearly not something to worry about wrt memory pressure. > We do read into tmp and free it in other places in the same function though > (as > you note above), so for code consistency alone this is worth

Re: Plug minor memleak in pg_dump

2022-02-02 Thread Daniel Gustafsson
> On 2 Feb 2022, at 09:29, Kyotaro Horiguchi wrote: > > At Tue, 1 Feb 2022 19:48:01 +0530, Bharath Rupireddy > wrote in >> On Tue, Feb 1, 2022 at 7:06 PM wrote: >>> >>> Hi, >>> >>> I noticed a minor memleak in pg_dump. ReadStr() returns a malloc'ed pointer >>> which >>> should then be

Re: Plug minor memleak in pg_dump

2022-02-02 Thread Kyotaro Horiguchi
At Tue, 1 Feb 2022 19:48:01 +0530, Bharath Rupireddy wrote in > On Tue, Feb 1, 2022 at 7:06 PM wrote: > > > > Hi, > > > > I noticed a minor memleak in pg_dump. ReadStr() returns a malloc'ed pointer > > which > > should then be freed. While reading the Table of Contents, it was called as > >

Re: Plug minor memleak in pg_dump

2022-02-01 Thread Bharath Rupireddy
On Tue, Feb 1, 2022 at 7:06 PM wrote: > > Hi, > > I noticed a minor memleak in pg_dump. ReadStr() returns a malloc'ed pointer > which > should then be freed. While reading the Table of Contents, it was called as > an argument > within a function call, leading to a memleak. > > Please accept the

Plug minor memleak in pg_dump

2022-02-01 Thread gkokolatos
Hi, I noticed a minor memleak in pg_dump. ReadStr() returns a malloc'ed pointer which should then be freed. While reading the Table of Contents, it was called as an argument within a function call, leading to a memleak. Please accept the attached as a proposed fix. Cheers, //GeorgiosFrom