Commit b3b92e099dd267bf2c5b86291eb2b36a6f8f6b3a

Patrick Steinhardt 2020-02-07T12:56:26

streams: openssl: ignore return value of `git_mutex_lock` OpenSSL pre-v1.1 required us to set up a locking function to properly support multithreading. The locking function signature cannot return any error codes, and as a result we can't do anything if `git_mutex_lock` fails. To silence static analysis tools, let's just explicitly ignore its return value by casting it to `void`.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/streams/openssl.c b/src/streams/openssl.c
index 98a3635..940fcef 100644
--- a/src/streams/openssl.c
+++ b/src/streams/openssl.c
@@ -160,7 +160,7 @@ static void openssl_locking_function(
 	lock = mode & CRYPTO_LOCK;
 
 	if (lock) {
-		git_mutex_lock(&openssl_locks[n]);
+		(void)git_mutex_lock(&openssl_locks[n]);
 	} else {
 		git_mutex_unlock(&openssl_locks[n]);
 	}