]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Pipe: don't leak session_security
authorSage Weil <sage@inktank.com>
Fri, 16 Nov 2012 20:21:14 +0000 (12:21 -0800)
committerSage Weil <sage@inktank.com>
Sun, 18 Nov 2012 16:29:00 +0000 (08:29 -0800)
Make sure we free old instances of sesseion_security before we reset the
pointer.

Signed-off-by: Sage Weil <sage@inktank.com>
src/msg/Pipe.cc

index 8c054732ce8a1aedf342dfa98d9bce6318ef363f..2846937ee40f664af8480c11930d0c9368bb865d 100644 (file)
@@ -322,6 +322,7 @@ int Pipe::accept()
        !authorizer_valid) {
       ldout(msgr->cct,0) << "accept: got bad authorizer" << dendl;
       reply.tag = CEPH_MSGR_TAG_BADAUTHORIZER;
+      delete session_security;
       session_security = NULL;
       goto reply;
     } 
@@ -539,6 +540,7 @@ int Pipe::accept()
   connection_state->set_features((int)reply.features & (int)connect.features);
   ldout(msgr->cct,10) << "accept features " << connection_state->get_features() << dendl;
 
+  delete session_security;
   session_security = get_auth_session_handler(msgr->cct, connect.authorizer_protocol, session_key,
                                              connection_state->get_features());
 
@@ -917,6 +919,7 @@ int Pipe::connect()
       // If we have an authorizer, get a new AuthSessionHandler to deal with ongoing security of the
       // connection.  PLR
 
+      delete session_security;
       if (authorizer != NULL) {
         session_security = get_auth_session_handler(msgr->cct, authorizer->protocol, authorizer->session_key,
                                                    connection_state->get_features());