summaryrefslogtreecommitdiff
path: root/src/common/hmac_openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/hmac_openssl.c')
-rw-r--r--src/common/hmac_openssl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/hmac_openssl.c b/src/common/hmac_openssl.c
index 44f36d51dcb..8874d6a240c 100644
--- a/src/common/hmac_openssl.c
+++ b/src/common/hmac_openssl.c
@@ -106,9 +106,13 @@ pg_hmac_create(pg_cryptohash_type type)
ctx->error = PG_HMAC_ERROR_NONE;
ctx->errreason = NULL;
+
/*
* Initialization takes care of assigning the correct type for OpenSSL.
+ * Also ensure that there aren't any unconsumed errors in the queue from
+ * previous runs.
*/
+ ERR_clear_error();
#ifdef HAVE_HMAC_CTX_NEW
#ifndef FRONTEND
ResourceOwnerEnlargeHMAC(CurrentResourceOwner);