Fix the memory leaks observed in static source code analysis

Resolves the memory leaks observed in static source code analysis.
And remove the csrStop routine call in csrClose function as csrStop
is already called in smeStop routine during the driver unload. Calling
csrStop in csrClose routine leads to memory leak during the driver
unload as csrStop posts message to PE and the message will not be
processed since the scheduler is already closed in the unload process.

Change-Id: I105f03c1ae3d006b0bc1bf37ab3dbd6a680fb658
CRs-Fixed: 507819
diff --git a/CORE/MAC/src/pe/lim/limSecurityUtils.c b/CORE/MAC/src/pe/lim/limSecurityUtils.c
index 85f12df..75f27ee 100644
--- a/CORE/MAC/src/pe/lim/limSecurityUtils.c
+++ b/CORE/MAC/src/pe/lim/limSecurityUtils.c
@@ -1299,6 +1299,7 @@
         FL("Posting REMOVE_STAKEY to HAL failed, reason=%X"),
         retCode );
     palFreeMemory(pMac->hHdd, pRemoveStaKeyParams);
+    pRemoveStaKeyParams = NULL;
 
     // Respond to SME with LIM_MLM_REMOVEKEY_CNF
     mlmRemoveKeyCnf.resultCode = eSIR_SME_HAL_SEND_MESSAGE_FAIL;
@@ -1307,6 +1308,10 @@
     return;
 
 end:
+  if (pRemoveStaKeyParams)
+  {
+    palFreeMemory(pMac->hHdd, pRemoveStaKeyParams);
+  }
   limPostSmeRemoveKeyCnf( pMac,
       psessionEntry,
       pMlmRemoveKeyReq,