pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: bianpan2016@163.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15103: Do not use pfree() to free pg_malloc() return value in vacuum_one_database()
Date: Fri, 9 Mar 2018 10:48:41 +0900
Message-ID: <20180309014841.GA25687@paquier.xyz> (raw)
In-Reply-To: <152055916778.4972.13890764985392726175@wrigleys.postgresql.org>
References: <152055916778.4972.13890764985392726175@wrigleys.postgresql.org>

On Fri, Mar 09, 2018 at 01:32:47AM +0000, PG Bug reporting form wrote:
> Details: In function vacuum_one_database(), the memory allocated with
> pg_malloc() (at line 435), but the return value is freed with pfree() (at
> line 530). I think use the function pg_free() paired with pg_malloc() is
> better here.

In practice it does not matter much as pfree is just a wrapper on top of
pg_free().  Please see fe_memutils.c, which lists all the memory-related
APIs for frontends.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (2+ messages)

Message-ID: <20180309014841.GA25687@paquier.xyz>
Permalink:  ../20180309014841.GA25687@paquier.xyz/
Also on:    postgresql.org/message-id/20180309014841.GA25687@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: michael@paquier.xyz, bianpan2016@163.com
  Subject: Re: BUG #15103: Do not use pfree() to free pg_malloc() return value in vacuum_one_database()
  In-Reply-To: <20180309014841.GA25687@paquier.xyz>
  References: <152055916778.4972.13890764985392726175@wrigleys.postgresql.org> <20180309014841.GA25687@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox