Commit a5f43b95 by Carlos Martín Nieto

Config file open: don't free memory that doesn't belong to us

On error, it would free the configuration object even though it didn't
own that memory, which would cause a double-free.

This fixes the first part of Issue #210

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
parent 4191d529
...@@ -261,7 +261,6 @@ static int config_open(git_config_file *cfg) ...@@ -261,7 +261,6 @@ static int config_open(git_config_file *cfg)
cleanup: cleanup:
cvar_list_free(&b->var_list); cvar_list_free(&b->var_list);
gitfo_free_buf(&b->reader.buffer); gitfo_free_buf(&b->reader.buffer);
free(cfg);
return git__rethrow(error, "Failed to open config"); return git__rethrow(error, "Failed to open config");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment