Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Tatsuo Ishii
>> Thanks for finding these accidental duplications, and to Ishii-san for >> committing the fix. Oops. >> >> +1 for this refactoring. > > Thanks for confirming. I will go ahead commit/push the patch. Done. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index

Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Tatsuo Ishii
Hi Thomas, > On Fri, Jun 15, 2018 at 8:42 PM, Antonin Houska wrote: >> Tatsuo Ishii wrote: >> >>> The changes were made by this commit to add infrastructure for sharing >>> temporary files between backends, according to the author (Thomas >>> Munro). >>> >>> https://git.postgresql.org/pg/commitd

Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Thomas Munro
On Fri, Jun 15, 2018 at 8:42 PM, Antonin Houska wrote: > Tatsuo Ishii wrote: > >> The changes were made by this commit to add infrastructure for sharing >> temporary files between backends, according to the author (Thomas >> Munro). >> >> https://git.postgresql.org/pg/commitdiff/dc6c4c9dc2a111519

Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Antonin Houska
Tatsuo Ishii wrote: > The changes were made by this commit to add infrastructure for sharing > temporary files between backends, according to the author (Thomas > Munro). > > https://git.postgresql.org/pg/commitdiff/dc6c4c9dc2a111519b76b22dc86c5608223b > > Your proposal looks reasonable but

Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Tatsuo Ishii
> Now I see that BufFileCreateShared() has similar problem with file->name. Right. > More generic problem I see is that the common initialization of BufFile is > repeated a few times. The attached patch tries to improve that (it also fixes > the duplicate allocation of file->name). The changes w

Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Antonin Houska
Now I see that BufFileCreateShared() has similar problem with file->name. More generic problem I see is that the common initialization of BufFile is repeated a few times. The attached patch tries to improve that (it also fixes the duplicate allocation of file->name). Tatsuo Ishii wrote: > > Mem

Re: Memory leaks in BufFileOpenShared()

2018-06-15 Thread Tatsuo Ishii
> Memory is allocated twice for "file" and "files" variables. Possible fix: > > diff --git a/src/backend/storage/file/buffile.c > b/src/backend/storage/file/buffile.c > index d8a18dd3dc..00f61748b3 100644 > --- a/src/backend/storage/file/buffile.c > +++ b/src/backend/storage/file/buffile.c > @@ -

Memory leaks in BufFileOpenShared()

2018-06-14 Thread Antonin Houska
Memory is allocated twice for "file" and "files" variables. Possible fix: diff --git a/src/backend/storage/file/buffile.c b/src/backend/storage/file/buffile.c index d8a18dd3dc..00f61748b3 100644 --- a/src/backend/storage/file/buffile.c +++ b/src/backend/storage/file/buffile.c @@ -277,10 +277,10 @