diff --git a/frameworks/src/core/base/dft_impl.cpp b/frameworks/src/core/base/dft_impl.cpp index 0a96428d4a7c8bfd4fd315b6c2550b3349ec8f13..28b2774e7155d989d5c2693b0b57aafae9e06755 100644 --- a/frameworks/src/core/base/dft_impl.cpp +++ b/frameworks/src/core/base/dft_impl.cpp @@ -87,6 +87,11 @@ void DftImpl::CallbackPageReplaced(int state, const char *param) value.routerPath = DftImpl::GetPagePath(); pageInfoFunc_(value); ACE_FREE(paramValue); + if (value.routerPath != nullptr) { + char *nonConstRouterPath = const_cast(value.routerPath); + ACE_FREE(nonConstRouterPath); + value.routerPath = nullptr; + } } } // namespace ACELite } // namespace OHOS