Memory leak with XLogFileCopy since de768844 (WAL file with .partial)

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Cc: hlinnaka(at)iki(dot)fi
Subject: Memory leak with XLogFileCopy since de768844 (WAL file with .partial)
Date: 2015-05-28 12:09:13
Message-ID: CAB7nPqRSe8GTDJy74Yp3cVONx5Xx9H6Xr82sTDHbNa_b1q8zCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Since commit de768844, XLogFileCopy of xlog.c returns to caller a
pstrdup'd string that can be used afterwards for other things.
XLogFileCopy is used in only one place, and it happens that the result
string is never freed at all, leaking memory.
Attached is a patch to fix the problem.
Regards,
--
Michael

Attachment Content-Type Size
20150528_xlog_memory_leak.patch text/x-patch 559 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2015-05-28 12:40:35 Re: pg_get_functiondef() does not show LEAKPROOF for leakproof functions
Previous Message Robert Haas 2015-05-28 12:06:16 Re: Possible pointer dereference