Re: BUG #4496: Memory leak in pg_dump.c? - Mailing list pgsql-bugs

From Tomáš Szépe
Subject Re: BUG #4496: Memory leak in pg_dump.c?
Date
Msg-id 20081030202558.GH13130@louise.pinerecords.com
Whole thread Raw
In response to Re: BUG #4496: Memory leak in pg_dump.c?  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: BUG #4496: Memory leak in pg_dump.c?
Re: BUG #4496: Memory leak in pg_dump.c?
List pgsql-bugs
> A pg_dump run is comparatively short-lived, so if Zdenek is right then
> there's no important leak here -- we're counting on program exit to
> release the memory.  There's probably little point in releasing things
> earlier than that.

Well, I'd tend to consider any logical part of a program that fails to
release the memory it uses to be bad coding practice.  You never know
when you're going to need to shuffle things around, change the context
of the code in a way that makes it long-lived, in turn causing the leak
to become a real problem.  Also, don't you like seeing the free()s paired
to their mallocs()s in a way that makes the allocations intuitively
correct? :)

--
Tomáš Szépe <szepe@pinerecords.com>


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #4496: Memory leak in pg_dump.c?
Next
From: Joe
Date:
Subject: Re: Bug #3924: Create Database with another encoding as the encoding from postgres