fixed prevent 54/47854/1
authorGukhwan Cho <gh78.cho@samsung.com>
Tue, 8 Sep 2015 02:14:18 +0000 (11:14 +0900)
committerGukhwan Cho <gh78.cho@samsung.com>
Wed, 9 Sep 2015 10:58:11 +0000 (19:58 +0900)
Change-Id: Id74fbcc6cce818ab0f504e7010857fadfbb3e996
Signed-off-by: Gukhwan Cho <gh78.cho@samsung.com>
server/db/ctsvc_db_plugin_name_helper.c

index 715b6e0..bb6be67 100644 (file)
@@ -326,12 +326,12 @@ int ctsvc_db_name_update(contacts_record_h record, bool is_my_profile)
        case CTSVC_LANG_ENGLISH:
        default:
                if (normal_name[CTSVC_NN_FIRST] && normal_name[CTSVC_NN_FIRST][0])
-                       temp_normal_first = normal_name[CTSVC_NN_FIRST];
+                       temp_normal_first = SAFE_STRDUP(normal_name[CTSVC_NN_FIRST]);
                else
                        name->first = NULL;
 
                if (normal_name[CTSVC_NN_LAST] && normal_name[CTSVC_NN_LAST][0])
-                       temp_normal_last = normal_name[CTSVC_NN_LAST];
+                       temp_normal_last = SAFE_STRDUP(normal_name[CTSVC_NN_LAST]);
                else
                        name->last = NULL;
                break;
@@ -353,6 +353,8 @@ int ctsvc_db_name_update(contacts_record_h record, bool is_my_profile)
        __ctsvc_make_name_lookup(CONTACTS_NAME_DISPLAY_ORDER_LASTFIRST,
                                                                temp_normal_first, temp_normal_last, &name->reverse_lookup);
 
+       free(temp_normal_first);
+       free(temp_normal_last);
        free(normal_name[CTSVC_NN_FIRST]);
        free(normal_name[CTSVC_NN_LAST]);