len_normal_first = SAFE_STRLEN(normal_name[CTSVC_NN_FIRST]);
len_normal_last = SAFE_STRLEN(normal_name[CTSVC_NN_LAST]);
temp_normal_first = calloc(1, len_normal_first + len_normal_last + 1);
+ if (temp_normal_first == NULL) {
+ ERR("calloc() Fail");
+ return CONTACTS_ERROR_OUT_OF_MEMORY;
+ }
if (normal_name[CTSVC_NN_LAST]) {
len = snprintf(temp_normal_first, len_normal_first + len_normal_last + 1,
"%s", normal_name[CTSVC_NN_LAST]);
switch (ret) {
case CTSVC_LANG_KOREAN:
temp_normal_first = calloc(1, SAFE_STRLEN(normal_name[CTSVC_NN_LAST]) + SAFE_STRLEN(normal_name[CTSVC_NN_LAST]) + 1);
+ if (temp_normal_first == NULL) {
+ ERR("calloc() Fail");
+ return CONTACTS_ERROR_OUT_OF_MEMORY;
+ }
if (normal_name[CTSVC_NN_LAST]) {
len = snprintf(temp_normal_first, SAFE_STRLEN(normal_name[CTSVC_NN_LAST]) + SAFE_STRLEN(normal_name[CTSVC_NN_LAST]) + 1,
"%s", normal_name[CTSVC_NN_LAST]);