Fix defects detected by static analysis
authorParkhi <h_w.park@samsung.com>
Thu, 15 Dec 2016 07:08:35 +0000 (16:08 +0900)
committerUze Choi <uzchoi@samsung.com>
Wed, 21 Dec 2016 08:32:23 +0000 (08:32 +0000)
 - mediator/submediator sample app.
 - enrolleeSecurity class memory issue.

Change-Id: Ia224aec14001f66085788eced8a4bb059c8e1715
Signed-off-by: Parkhi <h_w.park@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/15673
Reviewed-by: Jihun Ha <jihun.ha@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
(cherry picked from commit 9eb66a6863398d7be7f49a890d7b5e2829a97ddc)
Reviewed-on: https://gerrit.iotivity.org/gerrit/15841
Reviewed-by: Kevin Kane <kkane@microsoft.com>
service/easy-setup/mediator/richsdk/src/EnrolleeSecurity.cpp
service/easy-setup/sampleapp/mediator/linux/richsdk_sample/mediator.cpp
service/easy-setup/sampleapp/mediator/linux/richsdk_sample/submediator.cpp

index 0ed2756..a2d28cc 100755 (executable)
@@ -837,7 +837,6 @@ namespace OIC
             if(!rsrc)
             {
                 OIC_LOG(DEBUG, ENROLEE_SECURITY_TAG, "createAcl: OICCalloc error return");
-                FreeRsrc(rsrc);
                 OCDeleteACLList(acl);
                 return NULL;
             }
index 32c85cd..32f7b54 100755 (executable)
@@ -442,9 +442,9 @@ int main()
             return -1;
         }
 #endif
-    }catch (const std::exception& e)
+    }catch (...)
     {
-        std::cout << "Exception in main: "<<e.what();
+        std::cout << "Exception in main: " << std::endl;
     }
 
     while (true)
@@ -453,9 +453,9 @@ int main()
         {
             DisplayMenu();
         }
-        catch (const std::exception& e)
+        catch (...)
         {
-            std::cout << "Exception caught in main " << e.what() << std::endl;
+            std::cout << "Exception caught in main " << std::endl;
         }
     }
 
index 7b70611..dacc552 100755 (executable)
@@ -442,9 +442,9 @@ int main()
             return -1;
         }
 #endif
-    }catch (const std::exception& e)
+    }catch (...)
     {
-        std::cout << "Exception in main: "<<e.what();
+        std::cout << "Exception in main: " << std::endl;
     }
 
     while (true)
@@ -453,9 +453,9 @@ int main()
         {
             DisplayMenu();
         }
-        catch (const std::exception& e)
+        catch (...)
         {
-            std::cout << "Exception caught in main " << e.what() << std::endl;
+            std::cout << "Exception caught in main " << std::endl;
         }
     }