summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/config.c b/config.c
index 2dcbe901b6..c5873f3a70 100644
--- a/config.c
+++ b/config.c
@@ -148,8 +148,10 @@ static int handle_path_include(const char *path, struct config_include_data *inc
if (!is_absolute_path(path)) {
char *slash;
- if (!cf || !cf->path)
- return error(_("relative config includes must come from files"));
+ if (!cf || !cf->path) {
+ ret = error(_("relative config includes must come from files"));
+ goto cleanup;
+ }
slash = find_last_dir_sep(cf->path);
if (slash)
@@ -167,6 +169,7 @@ static int handle_path_include(const char *path, struct config_include_data *inc
ret = git_config_from_file(git_config_include, path, inc);
inc->depth--;
}
+cleanup:
strbuf_release(&buf);
free(expanded);
return ret;