ivi-layout-transition: Fix potential leak of memory pointed to by transition

Free transition before return. We don't need to use layout_transition_destroy,
because transition was not registered yet.

v2: consolidate memory leaks fixes

Signed-off-by: Lucas Tanure <tanure@linux.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
dev
Lucas Tanure 9 years ago committed by Bryce Harrington
parent 713acd6860
commit 9af0017077
  1. 3
      ivi-shell/ivi-layout-transition.c

@ -340,6 +340,7 @@ create_move_resize_view_transition(
data = malloc(sizeof(*data)); data = malloc(sizeof(*data));
if (data == NULL) { if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__); weston_log("%s: memory allocation fails\n", __func__);
free(transition);
return NULL; return NULL;
} }
@ -468,6 +469,7 @@ create_fade_view_transition(
data = malloc(sizeof(*data)); data = malloc(sizeof(*data));
if (data == NULL) { if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__); weston_log("%s: memory allocation fails\n", __func__);
free(transition);
return NULL; return NULL;
} }
@ -697,6 +699,7 @@ create_move_layer_transition(
data = malloc(sizeof(*data)); data = malloc(sizeof(*data));
if (data == NULL) { if (data == NULL) {
weston_log("%s: memory allocation fails\n", __func__); weston_log("%s: memory allocation fails\n", __func__);
free(transition);
return NULL; return NULL;
} }

Loading…
Cancel
Save