Fix static analysis issue
authorJihoi Kim <jihoi.kim@samsung.com>
Fri, 3 Jan 2025 06:34:01 +0000 (15:34 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Mon, 6 Jan 2025 00:50:14 +0000 (09:50 +0900)
- Fix UNINIT_CTOR
- Fix AUTO_CAUSES_COPY
- Fix COMPARE_RESULT_OF_NEW

Change-Id: I4dda5ce91d04101513b2821dc4ca9951a3f154d4
Signed-off-by: Jihoi Kim <jihoi.kim@samsung.com>
src/launchpad-process-pool/launchpad.cc
src/lib/launchpad-common/server_socket.cc
src/lib/launchpad-core/hw_acceleration_config.hh

index 3f294ee46186eda303880bf49aa6dc31b2e4b704..6bb13dbbc5d1381603a4684de739b5e2277f806f 100644 (file)
@@ -711,9 +711,9 @@ bool Launchpad::InitConfig() {
 
 void Launchpad::OnSigchldReceived(pid_t pid, int status) {
   fast_launches_.erase(pid);
-  auto found = pid_map_.find(pid);
+  const auto& found = pid_map_.find(pid);
   if (found != pid_map_.end()) {
-    auto appid = found->second;
+    const auto& appid = found->second;
     _E("pid=%d, appid=%s", pid, appid.c_str());
     pid_map_.erase(found);
   }
index af98bb73a358bbc0147e440296d7a3a0375b940d..a0cff221a7d67188e0a0e1b2e059359819a85023 100644 (file)
@@ -54,7 +54,8 @@ std::unique_ptr<ClientSocket> ServerSocket::Accept() {
     return nullptr;
   }
 
-  return std::unique_ptr<ClientSocket>(new ClientSocket(client_fd));
+  return std::unique_ptr<ClientSocket>(
+      new (std::nothrow) ClientSocket(client_fd));
 }
 
 void ServerSocket::Bind(const std::string& bindpoint) {
index d3ac2d90b880d7504440b4d04db2338803760cf4..717e48da60a866a6f00248191a40aebc6b7bf2ed 100644 (file)
@@ -33,7 +33,7 @@ class HWAccelerationConfig : public Vconf::IEvent {
 
  private:
   Vconf vconf_;
-  int hwacc_;
+  int hwacc_ = SETTING_HW_ACCELERATION_NONE;
   bool init_ = false;
 };