diff options
author | jacobkeeler <jacob.keeler@livioradio.com> | 2017-11-02 14:58:28 -0400 |
---|---|---|
committer | jacobkeeler <jacob.keeler@livioradio.com> | 2017-11-02 14:58:28 -0400 |
commit | c340d8c2905de81458756aa5fdb66307878cde75 (patch) | |
tree | 14585d662142dfc39f3bd786d07e32256dd7ba66 /src/components/application_manager/src/commands | |
parent | 5f9a93c34aac15c04181ecb28180dc6762f2daac (diff) | |
parent | 2b29c82396c6b24e15f8d54405821f39de379741 (diff) | |
download | sdl_core-c340d8c2905de81458756aa5fdb66307878cde75.tar.gz |
Merge remote-tracking branch 'dev-gh/fix/Memory_leaks' into develop
Diffstat (limited to 'src/components/application_manager/src/commands')
-rw-r--r-- | src/components/application_manager/src/commands/command_request_impl.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/application_manager/src/commands/command_request_impl.cc b/src/components/application_manager/src/commands/command_request_impl.cc index efd8c8f042..f461db814d 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -33,6 +33,7 @@ #include <algorithm> #include <string> #include "utils/macro.h" +#include "utils/make_shared.h" #include "application_manager/commands/command_request_impl.h" #include "application_manager/application_manager.h" #include "application_manager/message_helper.h" @@ -228,11 +229,9 @@ void CommandRequestImpl::SendResponse( current_state_ = kCompleted; } - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; - if (!result) { - LOG4CXX_ERROR(logger_, "Memory allocation failed."); - return; - } + smart_objects::SmartObjectSPtr result = + utils::MakeShared<smart_objects::SmartObject>(); + smart_objects::SmartObject& response = *result; response[strings::params][strings::message_type] = MessageType::kResponse; |