Re: Memory leaks in BufFileOpenShared()

Tatsuo Ishii <ishii@sraoss.co.jp>

From: Tatsuo Ishii <ishii@sraoss.co.jp>
To: ah@cybertec.at
Cc: thomas.munro@enterprisedb.com, pgsql-hackers@postgresql.org
Date: 2018-06-15T08:22:08Z
Lists: pgsql-hackers
> 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 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/dc6c4c9dc2a111519b76b22daaaac86c5608223b

Your proposal looks reasonable but I would like to hear from Thomas's
opinion as well.

Thomas?

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


Commits

  1. Fix memory leak in BufFileCreateShared().

  2. Fix memory leak.

  3. Add infrastructure for sharing temporary files between backends.