pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Konstantin Knizhnik <k.knizhnik@postgrespro.ru>
To: pgsql-bugs@lists.postgresql.org
Subject: Memory leak in formatting.c
Date: Mon, 2 Sep 2019 19:52:30 +0300
Message-ID: <94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ru> (raw)

Memory leak in formatting.c in case of using ICU.
Proposed trivial fix is attached.

-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

Attachments:

formatting.patch (text/x-patch, 922B) download diff --git a/src/backend/utils/adt/formatting.c b/src/backend/utils/adt/formatting.c index b3115e4..755ca6e 100644 --- a/src/backend/utils/adt/formatting.c +++ b/src/backend/utils/adt/formatting.c @@ -1584,6 +1584,7 @@ str_tolower(const char *buff, size_t nbytes, Oid collid) &buff_conv, buff_uchar, len_uchar); icu_from_uchar(&result, buff_conv, len_conv); pfree(buff_uchar); + pfree(buff_conv); } else #endif @@ -1707,6 +1708,7 @@ str_toupper(const char *buff, size_t nbytes, Oid collid) &buff_conv, buff_uchar, len_uchar); icu_from_uchar(&result, buff_conv, len_conv); pfree(buff_uchar); + pfree(buff_conv); } else #endif @@ -1831,6 +1833,7 @@ str_initcap(const char *buff, size_t nbytes, Oid collid) &buff_conv, buff_uchar, len_uchar); icu_from_uchar(&result, buff_conv, len_conv); pfree(buff_uchar); + pfree(buff_conv); } else #endif

view thread (2+ messages)  latest in thread

Message-ID: <94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ru>
Permalink:  ../94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ru/
Also on:    postgresql.org/message-id/94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ru

 ·  · 

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: k.knizhnik@postgrespro.ru
  Subject: Re: Memory leak in formatting.c
  In-Reply-To: <94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ru>
  References: <94c0ad0a-cbc2-e4a3-7829-2bdeaf9146db@postgrespro.ru>

* 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