Thread (16 messages) 16 messages, 5 authors, 2018-05-20

Re: [PATCH v2 3/3] unpack_trees_options: free messages when done

From: Martin Ågren <hidden>
Date: 2018-05-18 05:09:02

Possibly related (same subject, not in this thread)

On 18 May 2018 at 00:10, Junio C Hamano [off-list ref] wrote:
Martin Ågren [off-list ref] writes:
quoted
The `opts` string array contains multiple copies of the same pointers.
Be careful to only free each pointer once, then zeroize the whole array
so that we do not leave any dangling pointers.
I wonder if an approach that is longer-term a bit more maintainable
is to add a new string-list instance to opts, save these xstrfmt()'ed
messages to it when setup_unpack_trees_porcelain() create them, and
then make clear_unpack_trees_porcelain() pay *no* attention to msg[]
array and the positions of these allocated messages and duplicates
but just reclaim the resources held in that string-list, or
something like that.
Thank you for thoughts and this suggestion. I will try this out,
hopefully later today.

Martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help