diff -r 0ea12c182930 -r 63b81d807542 javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp --- a/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Mon Aug 23 14:24:31 2010 +0300 +++ b/javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp Thu Sep 02 13:22:59 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);