From: Sage Weil Date: Wed, 30 Jan 2019 16:55:12 +0000 (-0600) Subject: mon/Monitor: fix leak of auth_handler if we error out X-Git-Tag: v14.1.0~183^2~29 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b3defafb417fc57d3e2f876a59eb8b1313504e8b;p=ceph-ci.git mon/Monitor: fix leak of auth_handler if we error out Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index cac25ec1617..2fe98293373 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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