diff -r 85266cc22c7f -r f40128debb5d javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp --- a/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Fri Jun 11 13:33:44 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Wed Jun 23 18:07:10 2010 +0300 @@ -148,7 +148,7 @@ TPtrC8 uuidDes(uuidBytes, uuidByteLength); TRAPD(err, uuid.SetL(uuidDes)); - delete uuidBytes; + delete[] uuidBytes; uuidBytes = NULL; if (KErrNone != err) @@ -205,7 +205,7 @@ char *fileName = java::util::JavaCommonUtils::wstringToUtf8( persistentFileName); persistentRecFd = open(fileName, O_RDONLY); - delete fileName; + delete[] fileName; } catch (ExceptionBase ex) { @@ -618,7 +618,7 @@ write(mSrvRecFd, (char *) &aDeviceServiceClasses, sizeof(aDeviceServiceClasses)); - delete fileName; + delete[] fileName; } catch (ExceptionBase ex) { @@ -1286,7 +1286,7 @@ char *fileName = java::util::JavaCommonUtils::wstringToUtf8(persistentFileName); persistentRecFd = open(fileName, O_RDONLY); - delete fileName; + delete[] fileName; } catch (ExceptionBase ex) { @@ -1310,7 +1310,10 @@ unsigned int devServClass = 0; ret = read(persistentRecFd, &devServClass, sizeof(devServClass)); if (ret <= 0) + { + delete srvRecPopulator; return; + } elementBuilder = srvRecPopulator->SetDeviceServiceClass(devServClass);