mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 09:02:55 +00:00
config: make cvar_free behave more like other free functions
Make cvar_free return void instad of the next element, as it was mostly a hack to make cvar_list_free shorter but it's now using the list macros. Also check if the input is NULL and return immediately in that case. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
6b45cb8a89
commit
493384e39c
@ -37,15 +37,14 @@ static int config_parse(git_config *cfg_file);
|
||||
static int parse_variable(git_config *cfg, char **var_name, char **var_value);
|
||||
void git_config_free(git_config *cfg);
|
||||
|
||||
static git_cvar *cvar_free(git_cvar *var)
|
||||
static void cvar_free(git_cvar *var)
|
||||
{
|
||||
git_cvar *next = var->next;
|
||||
if (var == NULL)
|
||||
return;
|
||||
|
||||
free(var->name);
|
||||
free(var->value);
|
||||
free(var);
|
||||
|
||||
return next;
|
||||
}
|
||||
|
||||
static void cvar_list_free(git_cvar_list *list)
|
||||
|
Loading…
Reference in New Issue
Block a user