crypto/weakcryptospi/source/spi/cryptospiutil.cpp
changeset 108 ca9a0fc2f082
parent 94 0e6c5a9328b5
--- a/crypto/weakcryptospi/source/spi/cryptospiutil.cpp	Wed Oct 06 11:09:48 2010 +0530
+++ b/crypto/weakcryptospi/source/spi/cryptospiutil.cpp	Sat Oct 30 16:29:23 2010 +0530
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -41,10 +41,12 @@
 	RBuf8 rBuf;
 	TInt count=0;
 	CleanupClosePushL(rBuf);
+
+	CleanupClosePushL(stream);
 	TInt length=RetrieveCharacteristicsL(aInterface, stream, rBuf, count);
 	if (length<=4)	
 		{
-		CleanupStack::PopAndDestroy(&rBuf);
+		CleanupStack::PopAndDestroy(2);
 		return;
 		}
 		
@@ -56,6 +58,8 @@
 		aList.AppendL(temp);
 		CleanupStack::Pop(temp); //temp
 		}
+
+	CleanupStack::PopAndDestroy(&stream);
 	CleanupStack::PopAndDestroy(&rBuf);
 	}
 
@@ -65,10 +69,12 @@
 	RBuf8 rBuf;
 	TInt count=0;
 	CleanupClosePushL(rBuf);
+	CleanupClosePushL(stream);
+
 	TInt length=RetrieveCharacteristicsL(aInterface, stream, rBuf, count);
 	if (length<=4)	
 		{
-		CleanupStack::PopAndDestroy(&rBuf);
+		CleanupStack::PopAndDestroy(2);
 		return;
 		}
 		
@@ -80,6 +86,8 @@
 		aList.AppendL(temp);
 		CleanupStack::Pop(temp); //temp
 		}
+
+	CleanupStack::PopAndDestroy(&stream);
 	CleanupStack::PopAndDestroy(&rBuf);
 	}
 
@@ -119,10 +127,12 @@
 	
 	//Read the length
 	aStream.Open(aBuf);
+
 	len=aStream.ReadInt32L();
 	
 	//Read the count of the characteristics
 	aCount=aStream.ReadInt16L();
+
 	return len;	
 	}