diff --git a/frameworks/js/napi/nfc_napi_event.cpp b/frameworks/js/napi/nfc_napi_event.cpp index 9826e52..7e72ef4 100644 --- a/frameworks/js/napi/nfc_napi_event.cpp +++ b/frameworks/js/napi/nfc_napi_event.cpp @@ -52,7 +52,7 @@ void NapiEvent::EventNotify(AsyncEventData *asyncEvent) napi_open_handle_scope(asyncEvent->env_, &scope); if (scope == nullptr) { HILOGE("scope is nullptr"); - napi_close_handle_scope(asyncEvent->env_, scope); + delete asyncEvent; return; } napi_value undefine; diff --git a/interfaces/inner_api/src/nfc_tag_client.cpp b/interfaces/inner_api/src/nfc_tag_client.cpp index def01d8..0e78397 100644 --- a/interfaces/inner_api/src/nfc_tag_client.cpp +++ b/interfaces/inner_api/src/nfc_tag_client.cpp @@ -71,7 +71,7 @@ NfcTagClient::~NfcTagClient() const char* NfcTagClient::GetErrCodeString(ErrCode code) { if ((code >= 0) && (code <= NFC_ERR_MAX)) { - for (int i = 0; i < sizeof(g_errCodeMap)/sizeof(ErrCodeMap); ++i) { + for (int i = 0; i < static_cast(sizeof(g_errCodeMap)/sizeof(ErrCodeMap)); ++i) { if (g_errCodeMap[i].code == code) { return g_errCodeMap[i].str; }