pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix some memory leaks associated with parsing json and manifests
Date: Fri, 12 Apr 2024 14:59:20 +0000
Message-ID: <E1rvIN6-001knn-1H@gemulon.postgresql.org> (raw)

Fix some memory leaks associated with parsing json and manifests

Coverity complained about not freeing some memory associated with
incrementally parsing backup manifests. To fix that, provide and use a new
shutdown function for the JsonManifestParseIncrementalState object, in
line with a suggestion from Tom Lane.

While analysing the problem, I noticed a buglet in freeing memory for
incremental json lexers. To fix that remove a bogus condition on
freeing the memory allocated for them.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/661ab4e185784db79c194b5758555b1db3f30483

Modified Files
--------------
src/backend/backup/basebackup_incremental.c |  3 +++
src/bin/pg_combinebackup/load_manifest.c    |  3 +++
src/bin/pg_verifybackup/pg_verifybackup.c   |  3 +++
src/common/jsonapi.c                        | 21 ++++++++++-----------
src/common/parse_manifest.c                 | 13 ++++++++++++-
src/include/common/parse_manifest.h         |  1 +
6 files changed, 32 insertions(+), 12 deletions(-)



view thread (6+ messages)

Message-ID: <E1rvIN6-001knn-1H@gemulon.postgresql.org>
Permalink:  ../E1rvIN6-001knn-1H@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rvIN6-001knn-1H@gemulon.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix some memory leaks associated with parsing json and manifests
  In-Reply-To: <E1rvIN6-001knn-1H@gemulon.postgresql.org>

* 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