forked from enlightenment/efl
fix various trivial null derefs
Summary: CIDs 1401081, 1401044, 1400983, 1400960, 1400927, 1400799, 1396946, 1396944, 1383851, 1383847, 1382211, 1379921, 1379921 Reviewers: cedric Reviewed By: cedric Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10452
This commit is contained in:
parent
c12008b4d0
commit
20b592cef7
|
@ -187,6 +187,7 @@ code_parse_internal(Code *code)
|
||||||
if (tmp->str) free(tmp->str);
|
if (tmp->str) free(tmp->str);
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
|
if (!sym) break;
|
||||||
if ((begin - 1) > body)
|
if ((begin - 1) > body)
|
||||||
{
|
{
|
||||||
sym->body = mem_alloc(sizeof(char) * (begin - body - 1));
|
sym->body = mem_alloc(sizeof(char) * (begin - body - 1));
|
||||||
|
|
|
@ -5531,9 +5531,7 @@ test_genlist_show_item(void *data,
|
||||||
g_data->gl = gl;
|
g_data->gl = gl;
|
||||||
g_data->itc1 = api->itc1;
|
g_data->itc1 = api->itc1;
|
||||||
|
|
||||||
if (g_data)
|
max = g_data->max_items;
|
||||||
max = g_data->max_items;
|
|
||||||
else max = 20000;
|
|
||||||
for (i = 0; i <= max; i++)
|
for (i = 0; i <= max; i++)
|
||||||
elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
elm_genlist_item_append(gl, api->itc1, (void*)(uintptr_t)i, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
|
||||||
|
|
||||||
|
|
|
@ -509,6 +509,11 @@ _xml_attr_data(void *data EINA_UNUSED, const char *key, const char *value)
|
||||||
globalGraphical.model_path = strdup(value);/*Don't forget update UI*/
|
globalGraphical.model_path = strdup(value);/*Don't forget update UI*/
|
||||||
tmp = strdup(globalGraphical.model_path);
|
tmp = strdup(globalGraphical.model_path);
|
||||||
a = strrchr(tmp,'.');
|
a = strrchr(tmp,'.');
|
||||||
|
if (!a)
|
||||||
|
{
|
||||||
|
free(tmp);
|
||||||
|
return EINA_FALSE;
|
||||||
|
}
|
||||||
format = malloc(sizeof (char) * (strlen(a) - 1));
|
format = malloc(sizeof (char) * (strlen(a) - 1));
|
||||||
for (i = 0; i <= (int)strlen(a) - 1; i++)
|
for (i = 0; i <= (int)strlen(a) - 1; i++)
|
||||||
format[i] = a[i + 1];
|
format[i] = a[i + 1];
|
||||||
|
|
|
@ -516,6 +516,11 @@ _load_mesh(void *data EINA_UNUSED, Evas_Object *obj, void *event_info)
|
||||||
/*Get extension of file*/
|
/*Get extension of file*/
|
||||||
tmp = strdup(event_info);
|
tmp = strdup(event_info);
|
||||||
a = strrchr(tmp,'.');
|
a = strrchr(tmp,'.');
|
||||||
|
if (!a)
|
||||||
|
{
|
||||||
|
free(tmp);
|
||||||
|
return;
|
||||||
|
}
|
||||||
format = malloc(sizeof (char) * (strlen(a) - 1));
|
format = malloc(sizeof (char) * (strlen(a) - 1));
|
||||||
for (i = 0; i <= (int)strlen(a) - 1; i++)
|
for (i = 0; i <= (int)strlen(a) - 1; i++)
|
||||||
format[i] = a[i + 1];
|
format[i] = a[i + 1];
|
||||||
|
|
|
@ -113,7 +113,7 @@ _handler_reset(Eo *obj, Efl_Loop_Handler_Data *pd)
|
||||||
|
|
||||||
if (pd->handler_fd)
|
if (pd->handler_fd)
|
||||||
_handler_active_update(obj, pd);
|
_handler_active_update(obj, pd);
|
||||||
else
|
else if (pd->loop_data)
|
||||||
{
|
{
|
||||||
pd->handler_fd = _ecore_main_fd_handler_add
|
pd->handler_fd = _ecore_main_fd_handler_add
|
||||||
(pd->loop, pd->loop_data, obj, pd->fd, _handler_flags_get(pd),
|
(pd->loop, pd->loop_data, obj, pd->fd, _handler_flags_get(pd),
|
||||||
|
@ -122,7 +122,7 @@ _handler_reset(Eo *obj, Efl_Loop_Handler_Data *pd)
|
||||||
if (pd->handler_fd) _handler_active_update(obj, pd);
|
if (pd->handler_fd) _handler_active_update(obj, pd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (pd->win32)
|
else if (pd->win32 && pd->loop_data)
|
||||||
{
|
{
|
||||||
pd->handler_win32 = _ecore_main_win32_handler_add
|
pd->handler_win32 = _ecore_main_win32_handler_add
|
||||||
(pd->loop, pd->loop_data, obj, pd->win32, _cb_handler_win32, obj);
|
(pd->loop, pd->loop_data, obj, pd->win32, _cb_handler_win32, obj);
|
||||||
|
|
|
@ -274,6 +274,7 @@ _ephysics_body_soft_body_slice_new(EPhysics_Body *body, double delta, double max
|
||||||
faces = body->soft_body->m_faces;
|
faces = body->soft_body->m_faces;
|
||||||
|
|
||||||
slice->index = index;
|
slice->index = index;
|
||||||
|
if (!faces.size()) return slice;
|
||||||
slice->p[0].x = _ephysics_body_soft_body_slice_calc(
|
slice->p[0].x = _ephysics_body_soft_body_slice_calc(
|
||||||
faces[slice->index].m_n[0]->m_x.x(), delta, max);
|
faces[slice->index].m_n[0]->m_x.x(), delta, max);
|
||||||
slice->p[0].y = 1 - _ephysics_body_soft_body_slice_calc(
|
slice->p[0].y = 1 - _ephysics_body_soft_body_slice_calc(
|
||||||
|
|
|
@ -70,8 +70,7 @@ func7(EINA_UNUSED const Eina_Hash *hash,
|
||||||
val = data;
|
val = data;
|
||||||
if (!val)
|
if (!val)
|
||||||
*res = 1;
|
*res = 1;
|
||||||
|
else if (*val != 7)
|
||||||
if (*val != 7)
|
|
||||||
*res = 1;
|
*res = 1;
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
|
@ -208,6 +208,7 @@ EFL_START_TEST(eina_test_simple)
|
||||||
fail_if(test1 != NULL);
|
fail_if(test1 != NULL);
|
||||||
|
|
||||||
test1 = eina_matrixsparse_data_idx_get(matrix, 5, 3);
|
test1 = eina_matrixsparse_data_idx_get(matrix, 5, 3);
|
||||||
|
fail_if(!test1);
|
||||||
fail_if(*test1 != data[5][3]);
|
fail_if(*test1 != data[5][3]);
|
||||||
|
|
||||||
r = eina_matrixsparse_column_idx_clear(matrix, 3);
|
r = eina_matrixsparse_column_idx_clear(matrix, 3);
|
||||||
|
|
|
@ -92,6 +92,7 @@ return_zero_frame(Evas_Canvas3D_Mesh_Data *pd)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Evas_Canvas3D_Mesh_Frame *f;
|
Evas_Canvas3D_Mesh_Frame *f;
|
||||||
|
|
||||||
|
if (!pd) return NULL;
|
||||||
EINA_LIST_FOREACH(pd->frames, l, f)
|
EINA_LIST_FOREACH(pd->frames, l, f)
|
||||||
{
|
{
|
||||||
if (f->frame == 0)
|
if (f->frame == 0)
|
||||||
|
|
Loading…
Reference in New Issue