pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Clean up callers of JsonbIteratorNext().
Date: Sun, 15 Apr 2018 16:40:06 +0000
Message-ID: <E1f7khC-0003az-Qg@gemulon.postgresql.org> (raw)

Clean up callers of JsonbIteratorNext().

Coverity complained about the lack of a check on the return value in
parse_jsonb_index_flags' last call of JsonbIteratorNext.  Seems like
a reasonable gripe to me, especially since the code is depending on
that being WJB_DONE to not leak memory, so add a check.

In passing, improve a couple other places where the result was being
ignored, either by adding an assert or at least a cast to void.

Also, don't spell "WJB_DONE" as "0".  That's horrid coding style,
and it wasn't consistent either.

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f8a187bdbae6e9d3b7407c0c37e3494518496200

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)



Message-ID: <E1f7khC-0003az-Qg@gemulon.postgresql.org>
Permalink:  ../E1f7khC-0003az-Qg@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1f7khC-0003az-Qg@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 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-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Clean up callers of JsonbIteratorNext().
  In-Reply-To: <E1f7khC-0003az-Qg@gemulon.postgresql.org>
  References: <E1f7khC-0003az-Qg@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