Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData()

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: bianpan2016(at)163(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData()
Date: 2017-11-27 10:57:41
Message-ID: CAB7nPqRJMNnf6CsUufoSEFgAxcQAMCNU08i=WcqGebnB=4Kgig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Nov 27, 2017 at 7:35 PM, Amit Langote
<Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> It seems like a good idea to check cldir for NULL before freeing. Please
> find attached a patch to implement the same.

There are other places where this could be added like
CheckPointLogicalRewriteHeap() if you'd like to make the code more
consistent, but my opinion would be on the contrary to drop all the
checks after AllocateDir if ReadDir is directly used. Not worth
bothering at the end.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Amit Langote 2017-11-27 11:09:12 Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData()
Previous Message Michael Paquier 2017-11-27 10:53:30 Re: BUG #14929: Unchecked AllocateDir() return value in restoreTwoPhaseData()