Stefan Beller <stefanbeller@xxxxxxxxx> writes: > On 30.03.2015 22:06, Junio C Hamano wrote: >> If add-line-range does not take ownership of >> parent_range from us, shouldn't we be freeing it whether we called >> it or not??? > > In my understanding it does take ownership of it. (According to my code > review on friday) Hmmm. add_line_range() is given the "parent_range" as its third parameter, i.e. "range". If there is nothing for the commit yet, it calls line_log_data_copy() on it to make a deep copy and stores that in new, which is then used as the decoration for the commit---the copy is what is retained. I am not quite sure what the lifetime rule is for the original of this deep copy, i.e. "range", aka "parent_range" of the caller. Who holds pointers into it after this function is done? -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html