summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngela Stegmaier <angelabaker@ti.com>2017-08-11 16:25:41 -0500
committerAngela Stegmaier <angelabaker@ti.com>2017-08-11 16:33:20 -0500
commita4de3a3d0208870b0ef77fb4258a6003e734da3e (patch)
tree453c4ef5c9606b589a94ec45bd21e55ccfacf2ec
parenta618cb4dc3d07c216133cc6d5298dc17c7bd783c (diff)
downloaddra7xx-a4de3a3d0208870b0ef77fb4258a6003e734da3e.tar.gz
OMX_Core: Fix Leak in Case of Init Failure
In the case where the component initialization fails, pModule was not being set back to NULL, leading to that instance being left marked as "in-use". After enough initialization failures, no more instances could be created due to the array being full. This patch fixes the issue by setting the pModule[i] to NULL in case of initialization failure. Change-Id: I66830ebb4b07c96a193ea4b7e6fcc18b37e0d0ca Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
-rw-r--r--omx/base/omx_core/src/OMX_Core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/omx/base/omx_core/src/OMX_Core.c b/omx/base/omx_core/src/OMX_Core.c
index c42c2cc..abaeed5 100644
--- a/omx/base/omx_core/src/OMX_Core.c
+++ b/omx/base/omx_core/src/OMX_Core.c
@@ -242,6 +242,7 @@ OMX_ERRORTYPE OMX_GetHandle(OMX_HANDLETYPE *pHandle,
*pHandle = NULL;
pComponents[i] = NULL;
dlclose(pModules[i]);
+ pModules[i] = NULL;
goto EXIT;
}
eError = OMX_ErrorNone;