◐ Shell
clean mode source ↗

Config Memory Backend Corruption Fix by kcsaul · Pull Request #7232 · libgit2/libgit2

Adjusting git_config_list_get and git_config_list_get_unique would be preferable, but those are also called for the config file backend, where the config_file_take_list is used beforehand which calls `git_config_list_incref', so on the face of it, changing as suggested would require refactoring the config file at the same time which seems higher risk.

For future usages of git_config_list, running into the problem depends on whether the entry free function is setup in the same way, which is currently done externally for both the file and memory backends (by read_on_variable and parse_values), so it seemed appropriate to keep the reference counting external at the same layer, rather than attempting to refactor the config file backend and assume all future usages will setup the entry free function in the same way.