diff -r af3740e3753f -r c5b304f4d89b mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp --- a/mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp Wed Aug 18 09:46:20 2010 +0300 +++ b/mpserviceplugins/mpxsqlitedbcommon/src/mpxdbcommonutil.cpp Thu Sep 02 20:24:03 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; }