Audio HAL: Fix UAF if the effect is removed after close

am: 532240f4eb

Change-Id: I3a6ce3da68a1be76858f936d437860503b93c03b
This commit is contained in:
Mikhail Naganov
2019-12-04 17:34:44 -08:00
committed by android-build-merger

View File

@@ -713,7 +713,10 @@ Return<Result> Effect::close() {
#elif MAJOR_VERSION >= 6
// No need to join the processing thread, it is part of the API contract that the client
// must finish processing before closing the effect.
return analyzeStatus("EffectRelease", "", sContextCallFunction, EffectRelease(mHandle));
Result retval =
analyzeStatus("EffectRelease", "", sContextCallFunction, EffectRelease(mHandle));
EffectMap::getInstance().remove(mHandle);
return retval;
#endif
}