diff options
-rw-r--r-- | src/client/client-security-manager.cpp | 10 | ||||
-rw-r--r-- | src/license-manager/agent/main.cpp | 4 |
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(); |