]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/Monitor: fix leak of auth_handler if we error out
authorSage Weil <sage@redhat.com>
Wed, 30 Jan 2019 16:55:12 +0000 (10:55 -0600)
committerSage Weil <sage@redhat.com>
Thu, 7 Feb 2019 18:10:34 +0000 (12:10 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index cac25ec161757c8b37d1d3890dca0649d939d294..2fe98293373a9417e4df76a39344e8f3b1fc99be 100644 (file)
@@ -6117,6 +6117,7 @@ int Monitor::handle_auth_request(
        dout(10) << __func__ << " entity " << entity_name << " method "
                 << auth_method << " not among supported "
                 << auth_cluster_required.get_supported_set() << dendl;
+       delete auth_handler;
        return -EOPNOTSUPP;
       }
     } else {
@@ -6124,6 +6125,7 @@ int Monitor::handle_auth_request(
        dout(10) << __func__ << " entity " << entity_name << " method "
                 << auth_method << " not among supported "
                 << auth_cluster_required.get_supported_set() << dendl;
+       delete auth_handler;
        return -EOPNOTSUPP;
       }
     }
@@ -6136,6 +6138,7 @@ int Monitor::handle_auth_request(
       con->peer_global_id = authmon()->assign_global_id(false);
       if (!con->peer_global_id) {
        dout(1) << __func__ << " failed to assign global_id" << dendl;
+       delete auth_handler;
        return -EBUSY;
       }
       dout(10) << __func__ << "  assigned global_id " << con->peer_global_id