rgw: Fix dereference of empty optional
Due to the lack of a return, there was a case where an invalid ARN
could cause a dereference of an uninitialized boost::optional.
As a bit of defensive programming, restructure a couple functions to
make that kind of error impossible by ensuring the optional is only in
scope when it is initialized and relying less in early return on
error.
Fixes: http://tracker.ceph.com/issues/21962
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit
5249139be7a2748eabbf898cf340989875bfa509)