Re: [PATCH 2/7] sequencer: release a strbuf used in save_head()
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- May 22, 2012, 05:07 UTC
- Message-ID
- <CALkWK0kvjr3NSx6-8svz=PKb5ta_UwOUiF4uqh7GriwuJYncUA@mail.gmail.com>
- In-Reply-To
- <20120522042316.GA3080@burratino>
Hi Jonathan,
Jonathan Nieder wrote:
Show 12 quoted lines
> Ramkumar Ramachandra wrote:
>> Christian Couder wrote:
>>> [...]
>> if (write_in_full(fd, buf.buf, buf.len) < 0) {
>> strbuf_release(&buf);
>> die_errno(_("Could not write to %s"), todo_file);
>
> [...]
> And
> looking at it from the other side, doesn't using exit mean that you
> cannot be valgrind-clean anyway, since allocations by functions higher
> in the call chain do not get a chance to be freed?Good point; save_todo() sets a bad example. For symmetry, should these two instances of strbuf_release() before die() be removed in a separate patch?
Ram