diff --git a/platform/src/ssl_sess_cache.cpp b/platform/src/ssl_sess_cache.cpp index 52b57a8..ca29834 100644 --- a/platform/src/ssl_sess_cache.cpp +++ b/platform/src/ssl_sess_cache.cpp @@ -268,14 +268,15 @@ void down_session_set(struct sess_cache * cache, const SSL_SESSION * sess) SSL_SESSION * down_session_get(struct sess_cache * cache, const unsigned char * id, int idlen) { - SSL_SESSION * sess = NULL; + struct sess_get_args result; + memset(&result, 0, sizeof(result)); long cb_ret = 0; assert(cache->served_for == CONN_DIR_DOWNSTREAM); - MESA_htable_search_cb(cache->hash, id, (unsigned int) idlen, sess_cache_get_cb, &sess, &cb_ret); + MESA_htable_search_cb(cache->hash, id, (unsigned int) idlen, sess_cache_get_cb, &result, &cb_ret); if (cb_ret == SESS_CACHE_FOUND) { ATOMIC_INC(&(cache->hit_cnt)); - return sess; + return result.sess; } else {