javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp
changeset 23 98ccebc37403
parent 21 2a9601315dfc
child 78 71ad690e91f5
child 83 26b2b12093af
--- a/javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp	Mon May 03 12:27:20 2010 +0300
+++ b/javaextensions/wma/sms_cbs/pushplugin/src/serverconnectionbase.cpp	Fri May 14 15:47:24 2010 +0300
@@ -133,7 +133,16 @@
     {
         path += std::wstring(tok);
         path += L"\\";
-        char *dirName = JavaCommonUtils::wstringToUtf8(path);
+        char *dirName =0;
+        try 
+        {
+           dirName = JavaCommonUtils::wstringToUtf8(path);
+        }
+        catch (ExceptionBase ex)
+        {
+           delete[] stringToTokenize;
+           return -1;
+        }
         if (ableToOpen)
         {
             if (0 != lstat(dirName, &temp))
@@ -169,10 +178,11 @@
     JELOG2(EWMA);
     std::wstring path1;
     path1 +=  aDirPath;
+    char* path =0;
     int error = 0;
     try
     {
-        char* path = JavaCommonUtils::wstringToUtf8(path1);
+        path = JavaCommonUtils::wstringToUtf8(path1);
         LOG1(EWMA, EInfo, "WMA : Removing Message Store %s",path);
         struct stat temp;
         if (0 != lstat(path, &temp))
@@ -211,7 +221,9 @@
     }
     catch (ExceptionBase ex)
     {
+        delete[] path;
         ELOG(EWMA,"WMA : Cought an exception while removing Dir");
+        return -1;
     }
     return error;
 }