Fix static analysis issue 74/317574/1
authorJihoi Kim <jihoi.kim@samsung.com>
Fri, 3 Jan 2025 06:34:01 +0000 (15:34 +0900)
committerJihoi Kim <jihoi.kim@samsung.com>
Fri, 3 Jan 2025 06:34:33 +0000 (15:34 +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 f5433eed17374054338de75bab7d4553f749aac7..0526d3a68d747e84e2c80d4211a2623463827137 100644 (file)
@@ -732,9 +732,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 635a626c95b5d463d3c62da26831188f95866227..7409529091406996008f80fcd5ecc1f5d31ec31b 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;
 };