Use variable after free
authorTaejin Woo <tt.woo@samsung.com>
Wed, 23 Oct 2013 11:04:50 +0000 (20:04 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Wed, 23 Oct 2013 11:04:50 +0000 (20:04 +0900)
We need to free varialbe after use variable.
CID : 29780

Change-Id: I50f3dd0cc0472038288d4efc74efbc4bcdf57e4a

src/ui/bt-main-view.c

index c8a21fd..e3f24f1 100644 (file)
@@ -3205,7 +3205,10 @@ void _bt_main_remove_paired_device(bt_ug_data *ugd, bt_dev_t *dev)
 
        EINA_LIST_FOREACH_SAFE(ugd->paired_device, l, l_next, item) {
                if (item && (item == dev)) {
-                       elm_object_item_del(item->genlist_item);
+                       if (item->genlist_item) {
+                               elm_object_item_del(item->genlist_item);
+                               item->genlist_item = NULL;
+                       }
                        ugd->paired_device =
                            eina_list_remove_list(ugd->paired_device, l);
                        _bt_util_free_device_item(item);