From 7c003c5755591679276c7f6353b695b2e9ef5728 Mon Sep 17 00:00:00 2001 From: toddouska Date: Fri, 12 Apr 2013 17:07:00 -0700 Subject: [PATCH] add sanity check on cleanup for possible no init --- src/ssl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index e6615d477..311141a2a 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3127,6 +3127,9 @@ int CyaSSL_Cleanup(void) CYASSL_ENTER("CyaSSL_Cleanup"); + if (initRefCount == 0) + return 0; /* possibly no init yet */ + if (LockMutex(&count_mutex) != 0) { CYASSL_MSG("Bad Lock Mutex count"); return BAD_MUTEX_ERROR;