Re: [PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Jeff King
On Thu, Mar 31, 2016 at 05:08:30PM -0400, Eric Sunshine wrote: > On Thu, Mar 31, 2016 at 2:04 PM, Stefan Beller wrote: > > `value` is just a temporary scratchpad, so we need to make sure it doesn't > > leak. It is xstrdup'd in `git_config_get_string_const` and > > `parse_notes_merge_strategy` jus

Re: [PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Junio C Hamano
Eric Sunshine writes: > On Thu, Mar 31, 2016 at 2:04 PM, Stefan Beller wrote: >> `value` is just a temporary scratchpad, so we need to make sure it doesn't >> leak. It is xstrdup'd in `git_config_get_string_const` and >> `parse_notes_merge_strategy` just compares the string against predefined >>

Re: [PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Eric Sunshine
On Thu, Mar 31, 2016 at 2:04 PM, Stefan Beller wrote: > `value` is just a temporary scratchpad, so we need to make sure it doesn't > leak. It is xstrdup'd in `git_config_get_string_const` and > `parse_notes_merge_strategy` just compares the string against predefined > values, so no need to keep it

[PATCHv3 1/4] notes: don't leak memory in git_config_get_notes_strategy

2016-03-31 Thread Stefan Beller
`value` is just a temporary scratchpad, so we need to make sure it doesn't leak. It is xstrdup'd in `git_config_get_string_const` and `parse_notes_merge_strategy` just compares the string against predefined values, so no need to keep it around longer. Instead of using `git_config_get_string_const`,