Appease SVACE 58/280158/1
authorKonrad Lipinski <k.lipinski2@samsung.com>
Wed, 24 Aug 2022 12:07:36 +0000 (14:07 +0200)
committerKonrad Lipinski <k.lipinski2@samsung.com>
Wed, 24 Aug 2022 12:07:36 +0000 (14:07 +0200)
Change-Id: I9da1046731377e5c47096f34769f38aa67a23ae2

src/client/client-security-manager.cpp
src/license-manager/agent/main.cpp

index 314e4fb..cc50da2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2022 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2014-2022 Samsung Electronics Co., Ltd. All rights reserved
  *
  * This file is licensed under the terms of MIT License or the Apache License
  * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
@@ -1221,9 +1221,11 @@ static inline int security_manager_get_policy_internal(
             };
         } catch (...) {
             LogError("Error while parsing server response");
-            for (int i = 0; i < entriesCnt; ++i)
-                delete(entries[i]);
-            delete[] entries;
+            if (entries) {
+                for (int i = 0; i < entriesCnt; ++i)
+                    delete(entries[i]);
+                delete[] entries;
+            }
             return SECURITY_MANAGER_ERROR_UNKNOWN;
         }
         *p_size = entriesCnt;
index 854d666..c291708 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 Samsung Electronics Co., Ltd. All rights reserved.
+ * Copyright (c) 2017-2022 Samsung Electronics Co., Ltd. All rights reserved
  *
  * This file is licensed under the terms of MIT License or the Apache License
  * Version 2.0 of your choice. See the LICENSE.MIT file for MIT license details.
@@ -89,6 +89,8 @@ int main(int, char **) {
     } catch (const std::exception &e) {
         std::string error = e.what();
         ALOGE("Exception: %s", error.c_str());
+    } catch (...) {
+        ALOGE("Unknown exception");
     }
 
     CONF_modules_free();