summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonrad Lipinski <k.lipinski2@samsung.com>2022-08-24 14:07:36 +0200
committerKonrad Lipinski <k.lipinski2@samsung.com>2022-08-24 14:07:36 +0200
commit867f1ccab60916873dd0871005350521802876ab (patch)
tree98610b536af7d4ecd7337e782f3e671da05ab5be
parent7f24a8a7d04e789b95f730628f971b1373150163 (diff)
downloadsecurity-manager-867f1ccab60916873dd0871005350521802876ab.tar.gz
security-manager-867f1ccab60916873dd0871005350521802876ab.tar.bz2
security-manager-867f1ccab60916873dd0871005350521802876ab.zip
Appease SVACE
Change-Id: I9da1046731377e5c47096f34769f38aa67a23ae2
-rw-r--r--src/client/client-security-manager.cpp10
-rw-r--r--src/license-manager/agent/main.cpp4
2 files changed, 9 insertions, 5 deletions
diff --git a/src/client/client-security-manager.cpp b/src/client/client-security-manager.cpp
index 314e4fb2..cc50da2b 100644
--- a/src/client/client-security-manager.cpp
+++ b/src/client/client-security-manager.cpp
@@ -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;
diff --git a/src/license-manager/agent/main.cpp b/src/license-manager/agent/main.cpp
index 854d6668..c291708c 100644
--- a/src/license-manager/agent/main.cpp
+++ b/src/license-manager/agent/main.cpp
@@ -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();