Fix may be used uninitialized warnings

This commit is contained in:
Brad Chase
2017-03-21 19:14:07 -04:00
parent c453df927f
commit b958fa413e
2 changed files with 5 additions and 5 deletions

View File

@@ -110,7 +110,7 @@ namespace {
*/
error_code_i fillHandler (Context& context,
boost::optional<Handler const&>& result)
Handler const * & result)
{
if (! isUnlimited (context.role))
{
@@ -184,7 +184,7 @@ error_code_i fillHandler (Context& context,
return rpcNO_CLOSED;
}
result = *handler;
result = handler;
return rpcSUCCESS;
}
@@ -232,7 +232,7 @@ void getResult (
Status doCommand (
RPC::Context& context, Json::Value& result)
{
boost::optional <Handler const&> handler;
Handler const * handler = nullptr;
if (auto error = fillHandler (context, handler))
{
inject_error (error, result);