Skip to content

Commit

Permalink
[Media Common] [VP][MOS] fix double free issue
Browse files Browse the repository at this point in the history
set nullptr after free memory.
  • Loading branch information
pengwan1 authored and intel-mediadev committed Sep 18, 2024
1 parent a3b3781 commit 081fc57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions media_softlet/agnostic/common/os/mos_oca_rtlog_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,17 @@ void MosOcaRTLogMgr::UnregisterRes(OsContextNext *osDriverContext)
if (!resInterface.osInterface || !resInterface.osInterface->pfnFreeResource)
{
MOS_SafeFreeMemory(resInterface.ocaRTLogResource);
resInterface.ocaRTLogResource = nullptr;
MOS_SafeFreeMemory(resInterface.osInterface);
resInterface.osInterface = nullptr;
return;
}
resInterface.osInterface->pfnFreeResource(resInterface.osInterface, resInterface.ocaRTLogResource);
MOS_SafeFreeMemory(resInterface.ocaRTLogResource);
resInterface.ocaRTLogResource = nullptr;
Mos_DestroyInterface(resInterface.osInterface);
MOS_SafeFreeMemory(resInterface.osInterface);
resInterface.osInterface = nullptr;
}

MosOcaRTLogMgr::MosOcaRTLogMgr()
Expand Down

0 comments on commit 081fc57

Please sign in to comment.