pgsql: Fix memory leak.

2018-06-15 Thread Tatsuo Ishii
Fix memory leak. Memory is allocated twice for "file" and "files" variables in BufFileOpenShared(). Author: Antonin Houska Discussion: https://postgr.es/m/11329.1529045692%40localhost Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/969274d813018b08389956e493f691671

pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Alexander Korotkov
Fix memory leak in PLySequence_ToJsonbValue() PyObject returned from PySequence_GetItem() is not released. Similar code in PLyMapping_ToJsonbValue() is correct, because according to Python documentation PyList_GetItem() and PyTuple_GetItem() return a borrowed reference while PySequence_GetItem()

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Alexander Korotkov
On Fri, Jun 15, 2018 at 3:07 PM Alexander Korotkov wrote: > PyObject returned from PySequence_GetItem() is not released. Similar code in > PLyMapping_ToJsonbValue() is correct, because according to Python > documentation I'm sorry for misformatting commit message. I'll be more careful about t

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Tom Lane
Alexander Korotkov writes: > I'm sorry for misformatting commit message. I'll be more careful > about that in future. Maybe I just lack caffeine, but I don't see anything especially wrong with what you wrote? regards, tom lane

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Alexander Korotkov
On Fri, Jun 15, 2018 at 4:46 PM Tom Lane wrote: > > Alexander Korotkov writes: > > I'm sorry for misformatting commit message. I'll be more careful > > about that in future. > > Maybe I just lack caffeine, but I don't see anything especially > wrong with what you wrote? It doesn't contain somet

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Tom Lane
Alexander Korotkov writes: > On Fri, Jun 15, 2018 at 4:46 PM Tom Lane wrote: >> Maybe I just lack caffeine, but I don't see anything especially >> wrong with what you wrote? > It doesn't contain something particular wrong, but it's just badly > formatted. As I can see, we're keeping lines in co

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Alexander Korotkov
On Fri, Jun 15, 2018 at 5:25 PM Tom Lane wrote: > Alexander Korotkov writes: > > On Fri, Jun 15, 2018 at 4:46 PM Tom Lane wrote: > >> Maybe I just lack caffeine, but I don't see anything especially > >> wrong with what you wrote? > > > It doesn't contain something particular wrong, but it's just

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread David Fetter
On Fri, Jun 15, 2018 at 05:43:15PM +0300, Alexander Korotkov wrote: > On Fri, Jun 15, 2018 at 5:25 PM Tom Lane wrote: > > Alexander Korotkov writes: > > > On Fri, Jun 15, 2018 at 4:46 PM Tom Lane wrote: > > >> Maybe I just lack caffeine, but I don't see anything especially > > >> wrong with what

Re: pgsql: Fix memory leak in PLySequence_ToJsonbValue()

2018-06-15 Thread Tom Lane
David Fetter writes: > On Fri, Jun 15, 2018 at 05:43:15PM +0300, Alexander Korotkov wrote: >> On Fri, Jun 15, 2018 at 5:25 PM Tom Lane wrote: >>> Links such as Discussion: >>> tags tend to run over, but there's little to be done about that as long >>> as gmail insists on such ridiculously long me

pgsql: Fix off-by-one bug in XactLogCommitRecord

2018-06-15 Thread Alvaro Herrera
Fix off-by-one bug in XactLogCommitRecord Commit 1eb6d6527aae introduced zeroed alignment bytes in the GID field of commit/abort WAL records. Fixup commit cf5a1890592b later changed that representation into a regular cstring with a single terminating zero byte, but it also introduced an off-by-on

pgsql: Fix memory leak in BufFileCreateShared().

2018-06-15 Thread Tatsuo Ishii
Fix memory leak in BufFileCreateShared(). Also this commit unifies some duplicated code in makeBufFile() and BufFileOpenShared() into new function makeBufFileCommon(). Author: Antonin Houska Reviewed-By: Thomas Munro, Tatsuo Ishii Discussion: https://postgr.es/m/16139.1529049566%40localhost Bran