diff -r 3de6c4cf6b67 -r 2cbbefa9af78 mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp --- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp Wed Sep 01 12:32:02 2010 +0100 +++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp Tue Sep 14 21:14:08 2010 +0300 @@ -329,7 +329,8 @@ extractPos = KMCPathStartPos; // c:\..., include first '\' of the path } - TBuf fileName; + HBufC* fileNameBuf = HBufC::NewLC(aName.Length()+KMCIntegerLen); + TPtr fileName(fileNameBuf->Des()); if( extractPos ) { // append volume's unique Id to path to maintain uniqueness @@ -357,7 +358,7 @@ TInt narrowFileLen(0); TPtrC8 narrowFileName; #if defined(_UNICODE) - narrowFileLen = fileName.Length() * 2; + narrowFileLen = fileNameBuf->Des().Length() * 2; narrowFileName.Set((TUint8*)fileName.Ptr(), narrowFileLen); #else narrowFileLen = fileName.Length(); @@ -375,6 +376,9 @@ TUint32 uniqueId(0); uniqueId = aTableId << 28; uniqueId |= (ptr[3]&0x0F)<<24 | (ptr[2]<<16) | (ptr[1]<<8) | ptr[0]; + + CleanupStack::PopAndDestroy(fileNameBuf); + return uniqueId; }