summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/config.c b/src/config.c
index 757ff0387..4bd27a875 100644
--- a/src/config.c
+++ b/src/config.c
@@ -153,19 +153,19 @@ int git_config_snapshot(git_config **out, git_config *in)
git_config_backend *b;
if ((error = internal->file->snapshot(&b, internal->file)) < 0)
- goto on_error;
+ break;
if ((error = git_config_add_backend(config, b, internal->level, 0)) < 0) {
b->free(b);
- goto on_error;
+ break;
}
}
- *out = config;
- return error;
+ if (error < 0)
+ git_config_free(config);
+ else
+ *out = config;
-on_error:
- git_config_free(config);
return error;
}