There was really no need for this to be void and it made bugs very easy
to introduce accidentally, especially given that the free functions
needed to be passed a pointer to the pointer.
Also fix some bugs in the QUIC code detected immediately by this change.
.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23519)
# include "internal/time.h"
# include "internal/sockets.h"
# include "internal/quic_predef.h"
+# include "internal/thread_arch.h"
# include <openssl/bio.h>
# ifndef OPENSSL_NO_QUIC
int ossl_quic_reactor_block_until_pred(QUIC_REACTOR *rtor,
int (*pred)(void *arg), void *pred_arg,
uint32_t flags,
- CRYPTO_RWLOCK *mutex);
+ CRYPTO_MUTEX *mutex);
# endif
# include <openssl/crypto.h>
-typedef void CRYPTO_MUTEX;
-typedef void CRYPTO_CONDVAR;
+typedef struct crypto_mutex_st CRYPTO_MUTEX;
+typedef struct crypto_condvar_st CRYPTO_CONDVAR;
CRYPTO_MUTEX *ossl_crypto_mutex_new(void);
void ossl_crypto_mutex_lock(CRYPTO_MUTEX *mutex);
err:
if (ssl_base == NULL) {
#if defined(OPENSSL_THREADS)
- ossl_crypto_mutex_free(qc->mutex);
+ ossl_crypto_mutex_free(&qc->mutex);
#endif
OPENSSL_free(qc);
} else {
qta->t = ossl_crypto_thread_native_start(assist_thread_main,
qta, /*joinable=*/1);
if (qta->t == NULL) {
- ossl_crypto_condvar_free(qta->cv);
+ ossl_crypto_condvar_free(&qta->cv);
return 0;
}