diff options
author | Wan-Teh Chang <wtc@google.com> | 2014-01-03 14:47:42 -0800 |
---|---|---|
committer | Wan-Teh Chang <wtc@google.com> | 2014-01-03 14:47:42 -0800 |
commit | fa32255cdacd80fea2491686ab824fc7a069c07c (patch) | |
tree | b88c6d21299e7cb363e13257a385aaa74ab30b21 /lib/ssl/sslnonce.c | |
parent | 69aa5db980ebdb77906a3e60ae0bab602a309b7e (diff) | |
download | nss-hg-fa32255cdacd80fea2491686ab824fc7a069c07c.tar.gz |
Bug 949615: Delete unreachable code in ssl_DestroySID and ssl_LookupSID.
r=agl.
Diffstat (limited to 'lib/ssl/sslnonce.c')
-rw-r--r-- | lib/ssl/sslnonce.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/ssl/sslnonce.c b/lib/ssl/sslnonce.c index ae94012ed..c2493cdc6 100644 --- a/lib/ssl/sslnonce.c +++ b/lib/ssl/sslnonce.c @@ -165,10 +165,8 @@ static void ssl_DestroySID(sslSessionID *sid) { SSL_TRC(8, ("SSL: destroy sid: sid=0x%x cached=%d", sid, sid->cached)); - PORT_Assert((sid->references == 0)); - - if (sid->cached == in_client_cache) - return; /* it will get taken care of next time cache is traversed. */ + PORT_Assert(sid->references == 0); + PORT_Assert(sid->cached != in_client_cache); if (sid->version < SSL_LIBRARY_VERSION_3_0) { SECITEM_ZfreeItem(&sid->u.ssl2.masterKey, PR_FALSE); @@ -264,9 +262,9 @@ ssl_LookupSID(const PRIPv6Addr *addr, PRUint16 port, const char *peerID, SSL_TRC(8, ("SSL: Lookup1: sid=0x%x", sid)); - if (sid->expirationTime < now || !sid->references) { + if (sid->expirationTime < now) { /* - ** This session-id timed out, or was orphaned. + ** This session-id timed out. ** Don't even care who it belongs to, blow it out of our cache. */ SSL_TRC(7, ("SSL: lookup1, throwing sid out, age=%d refs=%d", @@ -274,11 +272,7 @@ ssl_LookupSID(const PRIPv6Addr *addr, PRUint16 port, const char *peerID, *sidp = sid->next; /* delink it from the list. */ sid->cached = invalid_cache; /* mark not on list. */ - if (!sid->references) - ssl_DestroySID(sid); - else - ssl_FreeLockedSID(sid); /* drop ref count, free. */ - + ssl_FreeLockedSID(sid); /* drop ref count, free. */ } else if (!memcmp(&sid->addr, addr, sizeof(PRIPv6Addr)) && /* server IP addr matches */ (sid->port == port) && /* server port matches */ /* proxy (peerID) matches */ |