javaextensions/bluetooth/bluetoothcommons/src.s60/servicerecord.cpp
changeset 47 f40128debb5d
parent 21 2a9601315dfc
child 72 1f0034e370aa
child 83 26b2b12093af
--- 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);