From: Junio C Hamano Date: Wed, 27 Apr 2016 21:11:54 GMT Subject: Re: [PATCH 01/15] string_list: add string_list_duplicate Message-ID: In-Reply-To: Stefan Beller writes: > When not duplicating git_config_get_value_multi("submodule.defaultGroup"); > I run into > > Program received signal SIGSEGV, Segmentation fault. > ... > So the string list seems to be corrupted here. > Someone stomping over our memory? How long is the result > of git_config_get_value_multi deemed to be stable and usable? That call goes to git_config_get_value_multi() -> git_configset_get_value_multi() -> configset_find_element() the returned value from there would be either NULL or the list of values that belong to the config cache layer, i.e. a caller of the API can peek but is not allowed to modify it. So if you are modifying the value you obtain from the API, you must make a copy; otherwise you will "stomp over" memory that belongs to the config cache layer, not to you.