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

2016-04-01 Thread Eric Sunshine
On Fri, Apr 1, 2016 at 1:14 PM, Jeff King wrote: > On Fri, Apr 01, 2016 at 10:03:25AM -0700, Junio C Hamano wrote: >> From: Stefan Beller >> Date: Thu, 31 Mar 2016 11:04:03 -0700 >> Subject: [PATCH] notes: don't leak memory in git_config_get_notes_strategy >>

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

2016-04-01 Thread Jeff King
On Fri, Apr 01, 2016 at 10:03:25AM -0700, Junio C Hamano wrote: > -- >8 -- > From: Stefan Beller > Date: Thu, 31 Mar 2016 11:04:03 -0700 > Subject: [PATCH] notes: don't leak memory in git_config_get_notes_strategy > > This function asks for the value of a configuration and >

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

2016-04-01 Thread Junio C Hamano
Junio C Hamano writes: > Eric Sunshine writes: > >> Meh. Rather than reverting the git_config_get_value(), it would have >> been just as easy and safer (less chance of a future change >> re-introducing a leak) if you had just inserted the necessary

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

2016-04-01 Thread Junio C Hamano
Eric Sunshine writes: > Meh. Rather than reverting the git_config_get_value(), it would have > been just as easy and safer (less chance of a future change > re-introducing a leak) if you had just inserted the necessary check > here: > > if (!value) > return

Re: [PATCHv4 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 8:35 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,

[PATCHv4 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. Signed-off-by: Stefan Beller