Skip to content

Commit c876853

Browse files
mlohvynenkoal1img
authored andcommitted
[iamserver] Reduce stack usage
Signed-off-by: Mykhailo Lohvynenko <Mykhailo_Lohvynenko@epam.com>
1 parent fca71fd commit c876853

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/iamserver/publicmessagehandler.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ grpc::Status PublicMessageHandler::GetPermissions([[maybe_unused]] grpc::ServerC
319319
{
320320
LOG_DBG() << "Process get permissions: funcServerID=" << request->functional_server_id().c_str();
321321

322-
aos::InstanceIdent aosInstanceIdent;
323-
aos::StaticArray<aos::FunctionPermissions, aos::cFuncServiceMaxCount> aosInstancePerm;
322+
aos::InstanceIdent aosInstanceIdent;
323+
auto aosInstancePerm = std::make_unique<aos::StaticArray<aos::FunctionPermissions, aos::cFuncServiceMaxCount>>();
324324

325325
if (auto err = GetPermHandler()->GetPermissions(
326-
request->secret().c_str(), request->functional_server_id().c_str(), aosInstanceIdent, aosInstancePerm);
326+
request->secret().c_str(), request->functional_server_id().c_str(), aosInstanceIdent, *aosInstancePerm);
327327
!err.IsNone()) {
328328
LOG_ERR() << "Failed to get permissions: " << err;
329329

@@ -337,7 +337,7 @@ grpc::Status PublicMessageHandler::GetPermissions([[maybe_unused]] grpc::ServerC
337337
instanceIdent.set_subject_id(aosInstanceIdent.mSubjectID.CStr());
338338
instanceIdent.set_instance(aosInstanceIdent.mInstance);
339339

340-
for (const auto& [key, val] : aosInstancePerm) {
340+
for (const auto& [key, val] : *aosInstancePerm) {
341341
(*permissions.mutable_permissions())[key.CStr()] = val.CStr();
342342
}
343343

0 commit comments

Comments
 (0)