summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-13 23:34:32 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-10-13 23:34:35 -0300
commit8686e14dc9bdc1fe18fe1d9d855fca64aa9e8580 (patch)
tree16c5ec3730155621db33cea49d1bcea5eadcbabf /src/lib/elementary
parent431d62d095761eb82236a2e4d65fd62a90bf72c6 (diff)
elm: Fix potential leak in cv request add
Summary: CID 1405809 Reviewers: zmike, cedric, bu5hm4n Reviewed By: cedric Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10174
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index 08673a3..fa2dd42 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -1783,14 +1783,13 @@ _efl_model_child_removed(void *data, const Efl_Event *event)
1783 Efl_Model_Children_Event *ev = event->info; 1783 Efl_Model_Children_Event *ev = event->info;
1784 MY_DATA_GET(data, pd); 1784 MY_DATA_GET(data, pd);
1785 Eina_List *requests = NULL; 1785 Eina_List *requests = NULL;
1786 Efl_Ui_Collection_Request *request = NULL;
1787#ifdef VIEWPORT_ENABLE 1786#ifdef VIEWPORT_ENABLE
1788 Eina_List *requests = NULL;
1789 unsigned int i; 1787 unsigned int i;
1790#endif 1788#endif
1791 unsigned int upper_end; 1789 unsigned int upper_end;
1792 long length; 1790 long length;
1793 unsigned int count; 1791 unsigned int count;
1792 uint64_t request_length;
1794 1793
1795 // FIXME: later optimization, instead of reloading everyone, we could actually track index and self 1794 // FIXME: later optimization, instead of reloading everyone, we could actually track index and self
1796 // update would be more efficient, but it is also more tricky 1795 // update would be more efficient, but it is also more tricky
@@ -1855,11 +1854,13 @@ _efl_model_child_removed(void *data, const Efl_Event *event)
1855 1854
1856 notify_manager: 1855 notify_manager:
1857#endif 1856#endif
1858 requests = _request_add(requests, &request, ev->index, EINA_TRUE); 1857 request_length = upper_end - ev->index;
1859 request->length = upper_end - ev->index;
1860 1858
1861 if (request->length > 0) 1859 if (request_length > 0)
1862 { 1860 {
1861 Efl_Ui_Collection_Request *request = NULL;
1862 requests = _request_add(requests, &request, ev->index, EINA_TRUE);
1863 request->length = request_length;
1863 requests = eina_list_append(requests, request); 1864 requests = eina_list_append(requests, request);
1864 requests = _batch_request_flush(requests, data, pd); 1865 requests = _batch_request_flush(requests, data, pd);
1865 } 1866 }