calendarui/controller/src/calenattachmentui.cpp
branchRCL_3
changeset 18 d68a4b5d5885
parent 16 55d60436f00b
child 28 96907930389d
--- a/calendarui/controller/src/calenattachmentui.cpp	Tue May 11 16:12:24 2010 +0300
+++ b/calendarui/controller/src/calenattachmentui.cpp	Tue May 25 12:41:10 2010 +0300
@@ -441,6 +441,7 @@
         if( KErrNone != err )
             {
             // if any error in opening file then return EFalse
+            CleanupStack::PopAndDestroy(filename);
             return EFalse;
             }
         
@@ -673,9 +674,17 @@
                             attachment->SetMimeTypeL(attachmentInfo->DataType().Des8());
                             entry->AddAttachmentL(*attachment);
                             CleanupStack::Pop(attachment);
-                            }                
+                            }
+                        else
+                            {
+                            CleanupStack::PopAndDestroy(data);
+                            }                        
                         }
-                        CleanupStack::PopAndDestroy(&fileHandle);
+                    else
+                        {
+                        CleanupStack::PopAndDestroy(data);
+                        }
+                    CleanupStack::PopAndDestroy(&fileHandle);
                     }
                 }
                         
@@ -845,11 +854,11 @@
         {
         aProtection = ETrue;
         
-        //DRM protected file: can't attach the DRM protected file 
-        CAknInformationNote* note = new ( ELeave ) CAknInformationNote(ETrue);
+        //DRM protected file: can't attach the DRM protected file
         HBufC* cannotAttach = StringLoader::LoadLC( 
                 R_QTN_CALEN_INFO_CANNOT_OPEN, CCoeEnv::Static() );
-        note->ExecuteLD( *cannotAttach );
+        CAknInformationNote* note = new ( ELeave ) CAknInformationNote(ETrue);
+        note->ExecuteLD( *cannotAttach );        
         CleanupStack::PopAndDestroy( cannotAttach );
         }
     else