René Scharfe <l.s.r@xxxxxx> writes: >> - tip_table.table[tip_table.nr].refname = xstrdup(refname); >> + tip_table.table[tip_table.nr].refname = shorten_unambiguous ? refname : >> + xstrdup(refname); > > Hmm, this works based on knowledge about the inner workings of > name_ref_abbrev(), which provides the refname. Could be cleaned up by > inlining that short function, or by moving the xstrdup() call there. Yeah, name_ref_abbrev() returns sometimes an allocated and some other times a borrowed piece of memory, which is a poor design that ignores memory ownership issues. Luckily the function being touched is the sole caller of it, and I agree with you that inlining may give us a better fix.