From: Tomasz Swierczek Date: Thu, 6 Jul 2023 09:52:54 +0000 (+0200) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/unified/20230712.040719~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F04%2F295404%2F1;p=platform%2Fcore%2Fsecurity%2Faskuser.git Fix static analysis issues Change-Id: I7b2dc65e39e8da4c62c3396620dc502be839d611 --- diff --git a/src/notification-daemon/Logic.cpp b/src/notification-daemon/Logic.cpp index d0f10c5..8e6761f 100644 --- a/src/notification-daemon/Logic.cpp +++ b/src/notification-daemon/Logic.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Samsung Electronics Co., Ltd. All rights reserved + * Copyright (c) 2017-2023 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -345,7 +345,7 @@ void Logic::extResponse(Protocol::ConnectionFd fd, Protocol::RequestId id, std::map received; unsigned int i = 0; - for (auto p : privacies) { + for (auto &p : privacies) { received[p] = responses[i++]; if (received[p] != ASKUSER_DENY_ONCE && diff --git a/src/notification-daemon/ui/UIAppInvoker.cpp b/src/notification-daemon/ui/UIAppInvoker.cpp index cb4c594..13e92f2 100644 --- a/src/notification-daemon/ui/UIAppInvoker.cpp +++ b/src/notification-daemon/ui/UIAppInvoker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. All rights reserved + * Copyright (c) 2020 - 2023 Samsung Electronics Co., Ltd. All rights reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -127,7 +127,7 @@ bool UIAppInvoker::invoke(int popup_id, pid_t caller_app_pid, const std::string memset(privacies_c, 0, privacies.size()); - for (auto p : privacies) { + for (auto &p : privacies) { if (!(privacies_c[i] = new char[p.size() + 1])){ ALOGE("Cannot allocate memory for bundle creation"); ret = -1;