On Sun, Sep 12 2021, Junio C Hamano wrote: > Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes: > >> Or maybe the whole approch of the string_list API is just a dead-end in >> API design, i.e. it shouldn't have any "dup" mode, just nodup, if you >> need something dup'd you xstrdup()-it. > > ;-) I realize in practice that's a bit too much, i.e. it's very useful to be able to use a string_list to account for a bunch of already-allocated memory without strduping everything. It's just unfortunate that you can't look at any code that works with the API and understand whether it does an implicit xstrdup() or not without tracking down its current state / where it got allocated at.