diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2009-09-02 12:50:52 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2009-09-02 12:50:52 -0700 |
commit | 845fe88e793e8bbdf6824b2e158ed3e1372df9a6 (patch) | |
tree | 1fd63725ea642209d625d276ac991cae9b23bd6b /wilink_6_1/stad | |
parent | ea0e64cebf60071015a036d7ea77363512f75d30 (diff) | |
download | ti-845fe88e793e8bbdf6824b2e158ed3e1372df9a6.tar.gz |
Fix memory leaks.
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wilink_6_1/stad')
4 files changed, 23 insertions, 0 deletions
diff --git a/wilink_6_1/stad/src/Connection_Managment/externalSec.c b/wilink_6_1/stad/src/Connection_Managment/externalSec.c index 0b470e8..0e932f8 100644 --- a/wilink_6_1/stad/src/Connection_Managment/externalSec.c +++ b/wilink_6_1/stad/src/Connection_Managment/externalSec.c @@ -322,3 +322,13 @@ TI_STATUS externalSecSM_Unexpected(struct externalSec_t *pExternalSec) return(TI_OK); } +TI_STATUS externalSec_unload(struct externalSec_t *pExternalSec) +{ + TI_STATUS status = TI_NOK; + if (!pExternalSec) { + return status; + } + status = fsm_Unload(pExternalSec->hOs, pExternalSec->pExternalSecSm); + os_memoryFree(pExternalSec->hOs, pExternalSec, sizeof(struct externalSec_t)); + return status; +} diff --git a/wilink_6_1/stad/src/Connection_Managment/externalSec.h b/wilink_6_1/stad/src/Connection_Managment/externalSec.h index d7253ba..ab29680 100644 --- a/wilink_6_1/stad/src/Connection_Managment/externalSec.h +++ b/wilink_6_1/stad/src/Connection_Managment/externalSec.h @@ -100,4 +100,5 @@ TI_STATUS externalSec_config(mainSec_t *pMainSec); struct externalSec_t* externalSec_create(TI_HANDLE hOs); TI_STATUS externalSec_event(struct externalSec_t *pExternalSec, TI_UINT8 event, void *pData); TI_STATUS externalSec_rsnComplete(struct externalSec_t *pExternalSec); +TI_STATUS externalSec_unload(struct externalSec_t *pExternalSec); #endif /* _EXTERNAL_SEC_H*/ diff --git a/wilink_6_1/stad/src/Connection_Managment/mainSecSm.c b/wilink_6_1/stad/src/Connection_Managment/mainSecSm.c index 867887c..97fb701 100644 --- a/wilink_6_1/stad/src/Connection_Managment/mainSecSm.c +++ b/wilink_6_1/stad/src/Connection_Managment/mainSecSm.c @@ -266,6 +266,13 @@ TI_STATUS mainSec_unload(mainSec_t *pMainSec) TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing FSM memory \n"); } + status = externalSec_unload(pMainSec->pExternalSec); + if (status != TI_OK) + { + /* report failure but don't stop... */ + TRACE0(pMainSec->hReport, REPORT_SEVERITY_ERROR, "MAIN_SEC_SM: Error releasing ExternalSec memory \n"); + } + os_memoryFree(pMainSec->hOs, pMainSec, sizeof(mainSec_t)); return TI_OK; diff --git a/wilink_6_1/stad/src/Ctrl_Interface/DrvMain.c b/wilink_6_1/stad/src/Ctrl_Interface/DrvMain.c index 4bc70b9..eff2e5b 100644 --- a/wilink_6_1/stad/src/Ctrl_Interface/DrvMain.c +++ b/wilink_6_1/stad/src/Ctrl_Interface/DrvMain.c @@ -658,6 +658,11 @@ TI_STATUS drvMain_Destroy (TI_HANDLE hDrvMain) scr_release (pDrvMain->tStadHandles.hSCR); } + if (pDrvMain->tStadHandles.hTxnQ != NULL) + { + txnQ_Destroy (pDrvMain->tStadHandles.hTxnQ); + } + if (pDrvMain->tStadHandles.hEvHandler != NULL) { EvHandlerUnload (pDrvMain->tStadHandles.hEvHandler); |