summaryrefslogtreecommitdiff
path: root/utils/MsgVMessage.cpp
diff options
context:
space:
mode:
authorAbhimanyu Swami <abhimanyu1.s@samsung.com>2021-09-23 21:18:19 +0530
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>2021-09-23 21:18:19 +0530
commit8fbee78d805967c5f72340455d18e7d5f6cc0c6e (patch)
tree7e0bffbef6edf51859dab5819a13781e767ca837 /utils/MsgVMessage.cpp
parentbca0e9ec6458f92795ca1f032ae94325cf285914 (diff)
downloadmsg-service-8fbee78d805967c5f72340455d18e7d5f6cc0c6e.tar.gz
msg-service-8fbee78d805967c5f72340455d18e7d5f6cc0c6e.tar.bz2
msg-service-8fbee78d805967c5f72340455d18e7d5f6cc0c6e.zip
Check return type
Change-Id: Idc673dcbda0328e7cb493c5c00101c7c4904b917 Signed-off-by: Abhimanyu Swami <abhimanyu1.s@samsung.com>
Diffstat (limited to 'utils/MsgVMessage.cpp')
-rwxr-xr-xutils/MsgVMessage.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/utils/MsgVMessage.cpp b/utils/MsgVMessage.cpp
index 39ba518..07e6d82 100755
--- a/utils/MsgVMessage.cpp
+++ b/utils/MsgVMessage.cpp
@@ -1464,6 +1464,10 @@ static inline char* __msgsvc_vmsg_translate_charset(char *src, int len)
temp_size = (src_len+1) * sizeof(UChar);
temp = (UChar *)malloc(temp_size);
+ if (temp == NULL) {
+ MSG_DEBUG("malloc() failed");
+ return NULL;
+ }
conv = ucnv_open(enc, &err);
MSG_WARN_M(U_FAILURE(err), "ucnv_open() Failed(%d), enc=%s", err, enc);
ucnv_toUChars(conv, temp, temp_size, val, src_len, &err);
@@ -1472,6 +1476,10 @@ static inline char* __msgsvc_vmsg_translate_charset(char *src, int len)
dest_size = temp_size*2;
dest = (char *)malloc(dest_size);
+ if (dest == NULL) {
+ MSG_DEBUG("malloc() failed");
+ return NULL;
+ }
conv = ucnv_open("UTF-8", &err);
MSG_WARN_M(U_FAILURE(err), "ucnv_open() Failed(%d), enc=%s", err, enc);
ucnv_fromUChars(conv, dest, dest_size, temp, u_strlen(temp), &err);