eapol/eapol_framework/eapol_symbian/am/type/generic/symbian/plugin/src/EapGeneric.cpp
changeset 27 9660a5eb236f
parent 26 9abfd4f00d37
child 34 ad1f037f1ac2
--- a/eapol/eapol_framework/eapol_symbian/am/type/generic/symbian/plugin/src/EapGeneric.cpp	Mon May 24 20:32:47 2010 +0300
+++ b/eapol/eapol_framework/eapol_symbian/am/type/generic/symbian/plugin/src/EapGeneric.cpp	Thu May 27 10:23:43 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 /*
-* %version: 53 %
+* %version: 54 %
 */
 
 // This is enumeration of EAPOL source code.
@@ -340,8 +340,6 @@
 			EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error)));
 	}
 	
-	CleanupStack::PushL(internal_settings);
- 	
 	internal_settings->m_IndexType = iIndexType;
 	internal_settings->m_Index = iIndex;
 
@@ -350,6 +348,8 @@
 		&(internal_settings->m_EAPType));
 	if (error != KErrNone)
 	{
+		delete internal_settings;
+
 		(void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
 		User::Leave(error);
 	}
@@ -357,7 +357,7 @@
 
 	eap_status_e status = m_server->delete_configuration(internal_settings);
 
-	CleanupStack::PopAndDestroy(internal_settings);
+	delete internal_settings;
 
 	if (status != eap_status_ok)
 	{
@@ -445,7 +445,6 @@
 			EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error)));
 	}
 	
-  CleanupStack::PushL(internal_settings);
 	internal_settings->m_IndexType = aIndexType;
 	internal_settings->m_Index = aIndex;
 
@@ -454,6 +453,8 @@
 		&(internal_settings->m_EAPType));
 	if (error != KErrNone)
 	{
+		delete internal_settings;
+
 		(void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
 		User::Leave(error);
 	}
@@ -464,7 +465,7 @@
 
 	if (status != eap_status_ok)
 	{
-		 CleanupStack::PopAndDestroy(internal_settings);
+		delete internal_settings;
 
 		User::Leave(m_am_tools->convert_eapol_error_to_am_error(
 			EAP_STATUS_RETURN(m_am_tools, status)));
@@ -476,6 +477,8 @@
 
 	if (iCompletionStatus != eap_status_ok)
 	{
+		delete internal_settings;
+
 		User::Leave(m_am_tools->convert_eapol_error_to_am_error(
 			EAP_STATUS_RETURN(m_am_tools, iCompletionStatus)));
 	}
@@ -488,6 +491,8 @@
 		&(internal_settings->m_EAPType));
 	if (error != KErrNone)
 	{
+		delete internal_settings;
+
 		(void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
 		User::Leave(error);
 	}
@@ -503,7 +508,7 @@
 
 	status = m_server->set_index(internal_settings);
 
-	CleanupStack::PopAndDestroy(internal_settings);
+	delete internal_settings;
 
 	if (status != eap_status_ok)
 	{
@@ -542,8 +547,6 @@
 			EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error)));
 	}
 
-	CleanupStack::PushL(internal_settings);
-
 	eap_status_e status(eap_status_process_general_error);
 
 	TInt error(KErrNone);
@@ -562,7 +565,8 @@
 			&(internal_settings->m_EAPType));
 		if (error != KErrNone)
 		{
-			CleanupStack::PopAndDestroy(internal_settings);
+			delete internal_settings;
+
 			(void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
 			User::Leave(error);
 		}
@@ -579,7 +583,7 @@
 		status = m_am_tools->convert_am_error_to_eapol_error(error);
 	}
 
-	CleanupStack::PopAndDestroy(internal_settings);
+	delete internal_settings;
 
 	if (status != eap_status_ok)
 	{
@@ -616,7 +620,6 @@
 		User::Leave(m_am_tools->convert_eapol_error_to_am_error(
 			EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error)));
 	}
-  CleanupStack::PushL(internal_settings);
 
 	internal_settings->m_IndexType = iIndexType;
 	internal_settings->m_Index = iIndex;
@@ -626,7 +629,8 @@
 		&(internal_settings->m_EAPType));
 	if (error != KErrNone)
 	{
-		CleanupStack::PopAndDestroy(internal_settings);
+		delete internal_settings;
+
 		(void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
 		User::Leave(error);
 	}
@@ -640,7 +644,7 @@
 
 	eap_status_e status = m_server->get_configuration(internal_settings);
 
-	CleanupStack::PopAndDestroy(internal_settings);
+	delete internal_settings;
 
 	if (status != eap_status_ok)
 	{
@@ -715,6 +719,8 @@
 		&(internal_settings->m_EAPType));
 	if (error != KErrNone)
 	{
+		delete internal_settings;
+
 		(void)EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error));
 		User::Leave(error);
 	}