Skip to content
Browse files

Fix cleanup code to prevent freeing objects added to the cache

  • Loading branch information...
1 parent 48ed2db commit ed0930d9202bda94809435cae5eac8444a9cf3b7 @tmm1 tmm1 committed with Jul 8, 2011
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/event/ngx_event_openssl.c
View
4 src/event/ngx_event_openssl.c
@@ -1673,16 +1673,13 @@ ngx_ssl_new_session(ngx_ssl_conn_t *ssl_conn, ngx_ssl_session_t *sess)
ngx_rbtree_insert(&cache->session_rbtree, &sess_id->node);
- ngx_shmtx_unlock(&shpool->mutex);
-
/* A short leap... */
goto shm_done;
shm_failed:
ngx_log_error(NGX_LOG_ALERT, c->log, 0,
"could not add new SSL session to the SHM session cache");
-shm_done:
if (cached_sess) {
ngx_slab_free_locked(shpool, cached_sess);
}
@@ -1691,6 +1688,7 @@ ngx_ssl_new_session(ngx_ssl_conn_t *ssl_conn, ngx_ssl_session_t *sess)
ngx_slab_free_locked(shpool, sess_id);
}
+shm_done:
ngx_shmtx_unlock(&shpool->mutex);
}

0 comments on commit ed0930d

Please sign in to comment.
Something went wrong with that request. Please try again.