diff --git a/frameworks/ability_lite/example/entry/src/main/cpp/main_ability_slice.cpp b/frameworks/ability_lite/example/entry/src/main/cpp/main_ability_slice.cpp index cf0ef2a7eeb68ba358ee3d0a4707b19a5911d5c9..9957aa4ca3d74908df601ea0817bec75aa22291f 100644 --- a/frameworks/ability_lite/example/entry/src/main/cpp/main_ability_slice.cpp +++ b/frameworks/ability_lite/example/entry/src/main/cpp/main_ability_slice.cpp @@ -38,7 +38,6 @@ constexpr static uint8_t FONT_ID = 10; int32_t IpcMsgHandler(int funcId, ElementName *elementName, SvcIdentity *serviceSid, void *storeArg) { - printf("IpcMsgHandler, funcId is %d, serviceSid is %p\n", funcId, serviceSid); printf("elementName is %s, %s\n", elementName->bundleName, elementName->abilityName); if (serviceSid == nullptr) { return 0; diff --git a/frameworks/want_lite/src/want.cpp b/frameworks/want_lite/src/want.cpp index ac634fe6e4f13b1342ca32958c01b5b6e5e30885..cc2bc8ca0759d5805d316a789b8cb0db4d8a43bc 100644 --- a/frameworks/want_lite/src/want.cpp +++ b/frameworks/want_lite/src/want.cpp @@ -109,6 +109,11 @@ Tlv *EncapTlv(uint8_t type, uint8_t length, const void *value, uint8_t valueLen) } Tlv *newTlv = reinterpret_cast(AdapterMalloc(sizeof(Tlv))); + if (newTlv == nullptr) { + AdapterFree(entity); + return nullptr; + } + newTlv->type = type; newTlv->entity = entity; newTlv->totalLen = totalLen;