webengine/osswebengine/WebCore/platform/network/symbian/HttpRequestHeaderManager.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 25 0ed94ceaa377
--- a/webengine/osswebengine/WebCore/platform/network/symbian/HttpRequestHeaderManager.cpp	Fri Jul 03 15:54:40 2009 +0100
+++ b/webengine/osswebengine/WebCore/platform/network/symbian/HttpRequestHeaderManager.cpp	Thu Aug 27 07:44:59 2009 +0300
@@ -147,8 +147,8 @@
     const TStringTable& stringTable = m_Session.GetTable();
     TPtrC8 acceptMimeTypes;
     HBufC8* tmpBuf = NULL;
-    CleanupStack::PushL(tmpBuf);
-    //
+	TInt pushCounter( 0 );
+
     if(aRequest.mainLoad()) {
         acceptMimeTypes.Set(*TopLevelAcceptStringL(aRequest));
     } else {
@@ -159,6 +159,8 @@
         if(reqMimeTypes.Length() > 0) {
             // WebCore has set accept MIME type - leave alone
             tmpBuf = HBufC8::NewL(reqMimeTypes.Length());
+			CleanupStack::PushL(tmpBuf);
+			++pushCounter;
             tmpBuf->Des().Copy(reqMimeTypes);
             acceptMimeTypes.Set(*tmpBuf);
         } else {
@@ -166,11 +168,11 @@
             acceptMimeTypes.Set(KStarSlashStar8);
         }
     }
-    //
     RStringF str = m_StringPool.OpenFStringL(acceptMimeTypes);
     CleanupClosePushL(str);
+	++pushCounter;
     aHeaders.SetFieldL(m_StringPool.StringF(HTTP::EAccept, stringTable), str);
-    CleanupStack::PopAndDestroy(2); // str, tmpBuf
+    CleanupStack::PopAndDestroy(pushCounter);
 }
 
 // -----------------------------------------------------------------------------