summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Olmedo Escobar <carlos.olmedo.e@gmail.com>2015-01-17 19:43:02 +0100
committerBryce Harrington <bryce@osg.samsung.com>2015-01-28 18:51:17 -0800
commite82ba533e53190d596256724e1bf49042a839b67 (patch)
tree3469f5ef85220c4d5e6fb2429bea52350d6a4c45
parent7a8d67dedfcfc6b55421b0f5906ba9913ff61ee8 (diff)
ivi-shell-transition: check create_layout_transition() return value.
Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com> Reviewed-by: ntanibata@jp.adit-jv.com
-rw-r--r--ivi-shell/ivi-layout-transition.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index 1e9ee239..904e8d61 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -328,8 +328,10 @@ create_move_resize_view_transition(
uint32_t duration)
{
struct ivi_layout_transition *transition = create_layout_transition();
- struct move_resize_view_data *data = malloc(sizeof(*data));
+ if (transition == NULL)
+ return NULL;
+ struct move_resize_view_data *data = malloc(sizeof(*data));
if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__);
return NULL;
@@ -451,8 +453,10 @@ create_fade_view_transition(
uint32_t duration)
{
struct ivi_layout_transition *transition = create_layout_transition();
- struct fade_view_data *data = malloc(sizeof(*data));
+ if (transition == NULL)
+ return NULL;
+ struct fade_view_data *data = malloc(sizeof(*data));
if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__);
return NULL;
@@ -675,8 +679,10 @@ create_move_layer_transition(
uint32_t duration)
{
struct ivi_layout_transition *transition = create_layout_transition();
- struct move_layer_data *data = malloc(sizeof(*data));
+ if (transition == NULL)
+ return NULL;
+ struct move_layer_data *data = malloc(sizeof(*data));
if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__);
return NULL;
@@ -819,8 +825,10 @@ ivi_layout_transition_fade_layer(
}
transition = create_layout_transition();
- data = malloc(sizeof(*data));
+ if (transition == NULL)
+ return;
+ data = malloc(sizeof(*data));
if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__);
return;