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>
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)