summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangyoon Jang <jeremy.jang@samsung.com>2024-09-10 16:10:56 +0900
committerSangyoon Jang <jeremy.jang@samsung.com>2024-09-10 16:11:03 +0900
commit3775f95c2255f07f4ca0d2acd66c7ae6b406c9f2 (patch)
treedccd4617a8674df9d4f21843b87983bb8e477582
parent7c4d7972bc1218f10fa65de07d2a3144267c7f13 (diff)
downloadslp-pkgmgr-3775f95c2255f07f4ca0d2acd66c7ae6b406c9f2.tar.gz
slp-pkgmgr-3775f95c2255f07f4ca0d2acd66c7ae6b406c9f2.tar.bz2
slp-pkgmgr-3775f95c2255f07f4ca0d2acd66c7ae6b406c9f2.zip
Fix static analysis issue
Change-Id: I27551aa1cdb0e6e96085d894b78aee91c306651f Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
-rw-r--r--installer/pkgmgr_installer_signal_agent.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/installer/pkgmgr_installer_signal_agent.cc b/installer/pkgmgr_installer_signal_agent.cc
index 306e129..2704f07 100644
--- a/installer/pkgmgr_installer_signal_agent.cc
+++ b/installer/pkgmgr_installer_signal_agent.cc
@@ -307,10 +307,21 @@ static gboolean __handle_signal(gint fd,
/* get signal name (including terminating null byte) */
type_name = static_cast<char*>(malloc(type_len));
+ if (type_name == nullptr) {
+ LOGE("out of memory");
+ close(clifd);
+ return FALSE;
+ }
memcpy(type_name, buf, type_len);
/* get data */
data = malloc(data_len);
+ if (data == nullptr) {
+ LOGE("out of memory");
+ close(clifd);
+ free(type_name);
+ return FALSE;
+ }
memcpy(data, buf + type_len, data_len);
/* floating type GVariant instance */