mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 18:57:46 +00:00
openssl_stream: fix releasing OpenSSL locks
The OpenSSL library may require multiple locks to work correctly, where it is the caller's responsibility to initialize and release the locks. While we correctly initialized up to `n` locks, as determined by `CRYPTO_num_locks`, we were repeatedly freeing the same mutex in our shutdown procedure. Fix the issue by freeing locks at the correct index.
This commit is contained in:
parent
1d50f95546
commit
dd0b1e8cb6
@ -66,7 +66,7 @@ static void shutdown_ssl_locking(void)
|
||||
CRYPTO_set_locking_callback(NULL);
|
||||
|
||||
for (i = 0; i < num_locks; ++i)
|
||||
git_mutex_free(openssl_locks);
|
||||
git_mutex_free(&openssl_locks[i]);
|
||||
git__free(openssl_locks);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user