Commit 819492c1 by Patrick Steinhardt

refs: fix potential free of uninitialized variable

The `signature` variable in `git_reference_rename` isn't initialized and
neither does `git_reference__log_signature` always do. So if the latter
function fails, we'll call `git_signature_free` on this unininitialized
variable.

Fix the issue by initializing the pointer with `NULL`.
parent 9e81711b
......@@ -606,7 +606,7 @@ int git_reference_rename(
const char *log_message)
{
refs_update_head_payload payload;
git_signature *signature;
git_signature *signature = NULL;
git_repository *repo;
int error;
......
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