diff -r b034b1c214c2 -r e42293e811d8 mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp --- a/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Thu Jul 15 19:11:42 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/src/mmmtpdputility.cpp Thu Aug 19 10:24:28 2010 +0300 @@ -110,14 +110,8 @@ if ( mime->CompareF( KMimeTypeAudio3gpp ) == 0 || mime->CompareF( KMimeTypeVideo3gpp ) == 0 ) { - delete mime; - mime = NULL; format = EMTPFormatCode3GPContainer; } - } - - if ( mime != NULL ) - { delete mime; mime = NULL; } @@ -525,34 +519,15 @@ HBufC8* MmMtpDpUtility::OdfMimeTypeL( const TDesC& aFullPath ) { PRINT( _L( "MM MTP => MmMtpDpUtility::OdfMimeTypeL" ) ); - HBufC8* mimebuf = NULL; - CContent* content = CContent::NewL( aFullPath ); - CleanupStack::PushL( content ); // + content - - HBufC* buffer = HBufC::NewL( KMimeTypeMaxLength ); - CleanupStack::PushL( buffer ); // + buffer + CContent* content = CContent::NewLC( aFullPath ); // + content + HBufC* buffer = HBufC::NewLC( KMimeTypeMaxLength ); // + buffer TPtr data = buffer->Des(); - TInt err = content->GetStringAttribute( EMimeType, data ); - - if ( err == KErrNone ) - { - mimebuf = HBufC8::New( buffer->Length() ); + User::LeaveIfError( content->GetStringAttribute( EMimeType, data ) ); - if ( mimebuf == NULL ) - { - User::LeaveIfError( KErrNotFound ); - } - - mimebuf->Des().Copy( *buffer ); - } - - // leave if NULL - if ( mimebuf == NULL ) - { - User::Leave( KErrNotFound ); - } + HBufC8* mimebuf = HBufC8::NewL( buffer->Length() ); + mimebuf->Des().Copy( *buffer ); CleanupStack::PopAndDestroy( buffer ); // - buffer CleanupStack::PopAndDestroy( content ); // - content