Fix the svace issue (172902, 183416) 31/122931/2
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Apr 2017 04:21:06 +0000 (13:21 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 4 Apr 2017 04:34:39 +0000 (13:34 +0900)
Change-Id: I8b931ef91b9e0a32ee1e75250a42ab63cfa6d3d8
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
common/src/libraries/bt-util.c
common/src/ui/bt-profile-view.c

index 4a41ca3..420660d 100644 (file)
@@ -888,7 +888,7 @@ static bool __bt_util_write_vcard_to_file(int fd, contacts_record_h record, bool
                }
 
                size_left = strlen(vcard_buff);
-               while (size_left) {
+               while (size_left > 0) {
                        int written = write(fd, vcard_buff, size_left);
                        if (written == -1) {
                                BT_ERR("write() failed: %d", errno);
index b43bb13..bc93476 100644 (file)
@@ -234,7 +234,6 @@ static void __bt_profile_rename_device_ok_cb(void *data, Evas_Object *obj,
                if (BT_ERROR_NONE == bt_device_set_alias(dev->addr_str, str)) {
                        memset(dev->name, 0, DEVICE_NAME_MAX_LEN + 1);
                        g_strlcpy(dev->name, str, DEVICE_NAME_MAX_LEN + 1);
-                       free(str);
 
                        if (ugd->profile_vd)
                                _bt_update_genlist_item((Elm_Object_Item *)ugd->profile_vd->name_item);
@@ -246,6 +245,7 @@ static void __bt_profile_rename_device_ok_cb(void *data, Evas_Object *obj,
                ugd->rename_entry = NULL;
        }
        g_free(device_name_str);
+       g_free(str);
        FN_END;
 }