summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-04-01 09:37:55 +0200
committerPatrick Steinhardt <ps@pks.im>2016-04-01 09:37:55 +0200
commit83c93a7cc215956083e0c81155128adf4a5ca2f3 (patch)
tree41676b8781e43af94bcb94725a37ee0f647decbb
parent24ecf18e81143b4e5f75ef31fc5b10582067d253 (diff)
downloadlibgit2-83c93a7cc215956083e0c81155128adf4a5ca2f3.tar.gz
merge_driver: fix missing `goto done;`
The code initializing the merge driver registry accidentally forgot a `goto done` in case of an error. Because of this the next line, which registers the global shutdown callback for the merge drivers, is only called when an error occured. Fix this by adding the missing `goto done`. This fixes some memory leaks when the global state is shut down.
-rw-r--r--src/merge_driver.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/merge_driver.c b/src/merge_driver.c
index cc039dbb5..88a53ecdb 100644
--- a/src/merge_driver.c
+++ b/src/merge_driver.c
@@ -178,6 +178,7 @@ int git_merge_driver_global_init(void)
merge_driver_name__union, &git_merge_driver__union.base)) < 0 ||
(error = merge_driver_registry_insert(
merge_driver_name__binary, &git_merge_driver__binary)) < 0)
+ goto done;
git__on_shutdown(git_merge_driver_global_shutdown);