Skip to content

Commit 081fc57

Browse files
pengwan1intel-mediadev
authored andcommitted
[Media Common] [VP][MOS] fix double free issue
set nullptr after free memory.
1 parent a3b3781 commit 081fc57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

media_softlet/agnostic/common/os/mos_oca_rtlog_mgr.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,17 @@ void MosOcaRTLogMgr::UnregisterRes(OsContextNext *osDriverContext)
124124
if (!resInterface.osInterface || !resInterface.osInterface->pfnFreeResource)
125125
{
126126
MOS_SafeFreeMemory(resInterface.ocaRTLogResource);
127+
resInterface.ocaRTLogResource = nullptr;
127128
MOS_SafeFreeMemory(resInterface.osInterface);
129+
resInterface.osInterface = nullptr;
128130
return;
129131
}
130132
resInterface.osInterface->pfnFreeResource(resInterface.osInterface, resInterface.ocaRTLogResource);
131133
MOS_SafeFreeMemory(resInterface.ocaRTLogResource);
134+
resInterface.ocaRTLogResource = nullptr;
132135
Mos_DestroyInterface(resInterface.osInterface);
133136
MOS_SafeFreeMemory(resInterface.osInterface);
137+
resInterface.osInterface = nullptr;
134138
}
135139

136140
MosOcaRTLogMgr::MosOcaRTLogMgr()

0 commit comments

Comments
 (0)