summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Huuhko <kai.huuhko@gmail.com>2015-03-21 10:37:47 +0200
committerKai Huuhko <kai.huuhko@gmail.com>2015-03-21 10:37:47 +0200
commit1940b51f156273f3faecde6a43c0a8b2fdf8d409 (patch)
tree567432174f75390c162a9d50dc49c23b3e397067
parent149f7d12781587a86f231516ef0e169fa1aa1c0d (diff)
Evas.SmartObject: Use calloc to allocate the array
-rw-r--r--efl/evas/efl.evas_object_smart.pxi4
1 files changed, 2 insertions, 2 deletions
diff --git a/efl/evas/efl.evas_object_smart.pxi b/efl/evas/efl.evas_object_smart.pxi
index b8bc667..a27e05b 100644
--- a/efl/evas/efl.evas_object_smart.pxi
+++ b/efl/evas/efl.evas_object_smart.pxi
@@ -21,7 +21,7 @@ from efl.eo cimport Eo, EoIterator
21 21
22from cpython cimport Py_INCREF, Py_DECREF, PyObject_Call, \ 22from cpython cimport Py_INCREF, Py_DECREF, PyObject_Call, \
23 PyMem_Malloc, PyMem_Free 23 PyMem_Malloc, PyMem_Free
24from libc.stdlib cimport malloc 24from libc.stdlib cimport malloc, calloc
25from libc.string cimport strdup 25from libc.string cimport strdup
26 26
27#cdef object _smart_classes 27#cdef object _smart_classes
@@ -53,7 +53,7 @@ cdef Evas_Smart_Cb_Description *_descriptions_to_array(descs):
53 return NULL 53 return NULL
54 54
55 # allocate arr_len + 1 so it's NULL terminated 55 # allocate arr_len + 1 so it's NULL terminated
56 arr = <Evas_Smart_Cb_Description *>malloc(arr_len + 1 * sizeof(Evas_Smart_Cb_Description)) 56 arr = <Evas_Smart_Cb_Description *>calloc(arr_len + 1, sizeof(Evas_Smart_Cb_Description))
57 57
58 for i, desc in enumerate(descs): 58 for i, desc in enumerate(descs):
59 arr[i] = desc.desc[0] 59 arr[i] = desc.desc[0]