diff --git a/media_driver/agnostic/common/cm/cm_kernel_ex.cpp b/media_driver/agnostic/common/cm/cm_kernel_ex.cpp index 28296188d6f..b78ac740288 100644 --- a/media_driver/agnostic/common/cm/cm_kernel_ex.cpp +++ b/media_driver/agnostic/common/cm/cm_kernel_ex.cpp @@ -543,6 +543,7 @@ CmSurfaceState* CmKernelEx::GetSurfaceState(CmSurface *surface, uint32_t index) surfState = MOS_New(CmSurfaceStateVME, cmHalState); if (surfState == nullptr) { + MOS_DeleteArray(vmeValue); return nullptr; } surfState->Initialize((CM_HAL_VME_ARG_VALUE *)vmeValue);