pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Minor cleanup of backend SCRAM code.
Date: Thu, 13 Apr 2017 14:48:44 +0000
Message-ID: <E1cyg3A-0008FU-Cw@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Minor cleanup of backend SCRAM code.

Free each SASL message after sending it. It's not a lot of wasted memory,
and it's short-lived, but the authentication code in general tries to
pfree() stuff, so let's follow the example.

Adding the pfree() revealed a little bug in build_server_first_message().
It attempts to keeps a copy of the sent message, but it was missing a
pstrdup(), so the pointer started to dangle, after adding the pfree()
into CheckSCRAMAuth().

Reword comments and debug messages slightly, while we're at it.

Reviewed by Michael Paquier.

Discussion: https://www.postgresql.org/message-id/6490b975-5ee1-6280-ac1d-af975b19fb9a@iki.fi

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/00707fa58275e370dc445fa7e1130085aa04f37b

Modified Files
--------------
src/backend/libpq/auth-scram.c | 10 +++++-----
src/backend/libpq/auth.c       | 12 +++++++-----
2 files changed, 12 insertions(+), 10 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1cyg3A-0008FU-Cw@gemulon.postgresql.org>
Permalink:  ../E1cyg3A-0008FU-Cw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1cyg3A-0008FU-Cw@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: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Minor cleanup of backend SCRAM code.
  In-Reply-To: <E1cyg3A-0008FU-Cw@gemulon.postgresql.org>
  References: <E1cyg3A-0008FU-Cw@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