Skip to content

Commit dd0b1e8

Browse files
committed
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.
1 parent 1d50f95 commit dd0b1e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/openssl_stream.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static void shutdown_ssl_locking(void)
6666
CRYPTO_set_locking_callback(NULL);
6767

6868
for (i = 0; i < num_locks; ++i)
69-
git_mutex_free(openssl_locks);
69+
git_mutex_free(&openssl_locks[i]);
7070
git__free(openssl_locks);
7171
}
7272

0 commit comments

Comments
 (0)