I'm not sure what the implications are for you, but for what it's worth, when you create the `git_diff_list` (via an API a la `git_diff_tree_to_tree()` or what have you), libgit2 makes a copy of the pathspec internally and you don't have to keep the data around.

Additionally, you are under no obligation to call `git_strarray_free()` if it doesn't make sense for you to do so. The strarray structure is not opaque - so long as you build an array of pointers to nul-terminated strings with a correct count that remains allocated while the `git_diff_list` building function is called, you can dispose of it however you wish. (E.g. if you wanted to keep all the strings in one continuous block of memory and free it as a single block at the end, libgit2 doesn't care.)