Re: Avoid incorrect allocation in buildIndexArray

2020-09-14 Thread Ranier Vilela
Em dom., 13 de set. de 2020 às 22:46, Michael Paquier escreveu: > On Sat, Sep 12, 2020 at 12:40:49PM +0200, Julien Rouhaud wrote: > > agreed. > > Ok, done as ac673a1 then. > Thanks Michael. regards, Ranier Vilela

Re: Avoid incorrect allocation in buildIndexArray

2020-09-13 Thread Michael Paquier
On Sat, Sep 12, 2020 at 12:40:49PM +0200, Julien Rouhaud wrote: > agreed. Ok, done as ac673a1 then. -- Michael signature.asc Description: PGP signature

Re: Avoid incorrect allocation in buildIndexArray

2020-09-12 Thread Julien Rouhaud
Le sam. 12 sept. 2020 à 11:14, Michael Paquier a écrit : > On Fri, Sep 11, 2020 at 01:49:26PM +0200, Julien Rouhaud wrote: > > On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson > wrote: > >> Any reason not to bail early as per the attached? > > > > +1 > > Makes sense to me. This has also the ad

Re: Avoid incorrect allocation in buildIndexArray

2020-09-12 Thread Michael Paquier
On Fri, Sep 11, 2020 at 01:49:26PM +0200, Julien Rouhaud wrote: > On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson wrote: >> Any reason not to bail early as per the attached? > > +1 Makes sense to me. This has also the advantage to cause a crash if there is an attempt to refer to those empty a

Re: Avoid incorrect allocation in buildIndexArray

2020-09-11 Thread Ranier Vilela
On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson wrote: > > Looking at a pg_dump patch I realized that when we call buildIndexArray without > having found objects to index, we still call pg_malloc with zero which in turn > mallocs 1 byte. The byte in question is of course negligable, but it does

Re: Avoid incorrect allocation in buildIndexArray

2020-09-11 Thread Julien Rouhaud
On Fri, Sep 11, 2020 at 1:39 PM Daniel Gustafsson wrote: > > Looking at a pg_dump patch I realized that when we call buildIndexArray > without > having found objects to index, we still call pg_malloc with zero which in turn > mallocs 1 byte. The byte in question is of course negligable, but it d

Avoid incorrect allocation in buildIndexArray

2020-09-11 Thread Daniel Gustafsson
Looking at a pg_dump patch I realized that when we call buildIndexArray without having found objects to index, we still call pg_malloc with zero which in turn mallocs 1 byte. The byte in question is of course negligable, but it does seem cleaner to return early with NULL instead of returning an em