Commit 83c93a7c by Patrick Steinhardt

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.
parent 24ecf18e
...@@ -178,6 +178,7 @@ int git_merge_driver_global_init(void) ...@@ -178,6 +178,7 @@ int git_merge_driver_global_init(void)
merge_driver_name__union, &git_merge_driver__union.base)) < 0 || merge_driver_name__union, &git_merge_driver__union.base)) < 0 ||
(error = merge_driver_registry_insert( (error = merge_driver_registry_insert(
merge_driver_name__binary, &git_merge_driver__binary)) < 0) merge_driver_name__binary, &git_merge_driver__binary)) < 0)
goto done;
git__on_shutdown(git_merge_driver_global_shutdown); git__on_shutdown(git_merge_driver_global_shutdown);
......
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