]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Catch exceptions at const references
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 8 May 2018 23:53:19 +0000 (19:53 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 18 May 2018 13:30:35 +0000 (15:30 +0200)
/Never/ by value.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 25f6b639495ef9047480a286945793af50621bf6)

src/rgw/rgw_op.cc
src/rgw/rgw_swift_auth.cc

index d472490a1c3f8745026bcc3193072c9aaea7de08..c95ccf861cf81728c31b3774b9f7a7a71cd3624f 100644 (file)
@@ -4310,7 +4310,7 @@ int RGWDeleteObj::handle_slo_manifest(bufferlist& bl)
   try {
     deleter = std::unique_ptr<RGWBulkDelete::Deleter>(\
           new RGWBulkDelete::Deleter(store, s));
-  } catch (std::bad_alloc) {
+  } catch (const std::bad_alloc&) {
     return -ENOMEM;
   }
 
index 4e9b082eaae271ec72125fe7aecccd6aec0acc1d..d73b6d51d9635b985d8a3d5434c148c9fc10c17c 100644 (file)
@@ -399,7 +399,7 @@ ExternalTokenEngine::authenticate(const std::string& token,
     } else {
       swift_user = std::move(swift_groups[0]);
     }
-  } catch (std::out_of_range) {
+  } catch (const std::out_of_range&) {
     /* The X-Auth-Groups header isn't present in the response. */
     return result_t::deny(-EPERM);
   }