libpq: fix unlikely memory leak

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: libpq: fix unlikely memory leak
Date: 2005-06-29 08:25:50
Message-ID: 42C25B0E.1000400@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

The attached patch fixes a theoretical memory leak in libpq: if the
second malloc() fails due to OOM, the memory returned by the first
(successful) malloc() will be leaked.

Barring any objections I'll apply this tomorrow.

Per report from EnterpriseDB's Coverity analysis.

-Neil

Attachment Content-Type Size
libpq_send_passwd_mem_leak-1.patch text/x-patch 1.8 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Abhijit Menon-Sen 2005-06-29 09:47:31 spi_query/spi_fetchrow for pl/perl
Previous Message Sergej Sergeev 2005-06-29 07:44:05 Re: plperl features