]> git.ipfire.org Git - thirdparty/git.git/commit - config.c
config: let `config_store_data_clear()` handle `key`
authorMartin Ågren <martin.agren@gmail.com>
Sun, 20 May 2018 10:42:35 +0000 (12:42 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 May 2018 04:57:57 +0000 (13:57 +0900)
commite7347cb9ba350880e6ccccd6fa6a33cec04c5111
tree6ec50d48a50cb659c8fa42b03e5f616f97cee50f
parent3b82542dff46339a585c7dde3a40bc543f6212f8
config: let `config_store_data_clear()` handle `key`

Instead of remembering to free `key` in each code path, let
`config_store_data_clear()` handle that.

We still need to free it before replacing it, though. Move that freeing
closer to the replacing to be safe. Note that in that same part of the
code, we can no longer set `key` to the original pointer, but need to
`xstrdup()` it.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
config.c