telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmnettsy.cpp
branchRCL_3
changeset 18 17af172ffa5f
parent 15 8b9e023e329f
child 19 630d2f34d719
--- a/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmnettsy.cpp	Thu Jul 15 19:58:53 2010 +0300
+++ b/telephonyserverplugins/common_tsy/commontsy/src/mmtsy/cmmnettsy.cpp	Thu Aug 19 11:03:36 2010 +0300
@@ -3247,17 +3247,11 @@
 			
 			// if iGetPrefPLMNList, iClientIdGetPrefPLMN, and/or iBufSizeGetPrefPLMN are not NULL, phase 1 is called twice without calling phase 2.
 			// In this case, we should ignore the previous phase 1 and delete buffers.
-			if(iGetPrefPLMNList != NULL)
-				{
-				delete iGetPrefPLMNList;
-				iGetPrefPLMNList = NULL;
-				}
+			delete iGetPrefPLMNList;
+			iGetPrefPLMNList = NULL;
 			iBufSizeGetPrefPLMN = aBufSize;
-			if(iClientIdGetPrefPLMN != NULL)
-				{
-				delete iClientIdGetPrefPLMN;
-				iClientIdGetPrefPLMN = NULL;
-				}
+			delete iClientIdGetPrefPLMN;
+			iClientIdGetPrefPLMN = NULL;
 			// Copy client id (session and subsession handle). it's used for
             // matching phase 1 and 2 of a request
 			iClientIdGetPrefPLMN = new ( ELeave ) RMobilePhone::TClientId( *aId ); 
@@ -3384,16 +3378,10 @@
 	if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown != reqHandle)
 		{
 		iBufSizeGetPrefPLMN = NULL;
-		if(iClientIdGetPrefPLMN)
-			{
-			delete iClientIdGetPrefPLMN;
-			iClientIdGetPrefPLMN = NULL;
-			}
-		if(iGetPrefPLMNList)
-			{
-			delete iGetPrefPLMNList;
-			iGetPrefPLMNList = NULL;
-			}
+		delete iClientIdGetPrefPLMN;
+		iClientIdGetPrefPLMN = NULL;
+		delete iGetPrefPLMNList;
+		iGetPrefPLMNList = NULL;
         iMmPhoneTsy->ReqCompleted( reqHandle, KErrCancel );        
 		}
 	//if reqHandle is 0, it means  phase 1 has completed and the list retrieval cannot be cancelled
@@ -3452,11 +3440,8 @@
 	if(CMmPhoneTsy::EMultimodePhoneReqHandleUnknown == reqHandle)
 		{
 		TFLOGSTRING("TSY CompleteGetPreferredNetworksListPhase1: reqHandle is 0, cannot complete Phase1 list retrieval request!!");
-		if(iClientIdGetPrefPLMN)
-			{
-			delete iClientIdGetPrefPLMN;
-			iClientIdGetPrefPLMN = NULL;
-			}
+		delete iClientIdGetPrefPLMN;
+		iClientIdGetPrefPLMN = NULL;
 		}
 	else if(KErrNone == aError)
 		{
@@ -3479,7 +3464,6 @@
 				TFLOGSTRING2("TSY CompleteGetPreferredNetworksListPhase1: failed to stream the list into the buffer, error = %d!!", trapError);
 				completeError = trapError;
 				}
-			delete list;
 			}
 		else
 			{
@@ -3496,11 +3480,8 @@
 	if(completeError != KErrNone)
 		{
 		iMmPhoneTsy->ReqCompleted( reqHandle, aError );
-		if(iClientIdGetPrefPLMN)
-			{
-			delete iClientIdGetPrefPLMN;
-			iClientIdGetPrefPLMN = NULL;
-			}
+		delete iClientIdGetPrefPLMN;
+		iClientIdGetPrefPLMN = NULL;
 		}
 	
 	iBufSizeGetPrefPLMN = NULL;