mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-05 05:18:01 +02:00
animation: Fix potential leak of memory pointed to by move
Free move before return if animation is null. Signed-off-by: Lucas Tanure <tanure@linux.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
parent
3c241b18b8
commit
ed8dd4ef6a
1 changed files with 3 additions and 1 deletions
|
|
@ -471,8 +471,10 @@ weston_move_scale_run(struct weston_view *view, int dx, int dy,
|
|||
animation = weston_view_animation_create(view, start, end, move_frame,
|
||||
NULL, move_done, data, move);
|
||||
|
||||
if (animation == NULL)
|
||||
if (animation == NULL){
|
||||
free(move);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
weston_spring_init(&animation->spring, 400.0, 0.0, 1.0);
|
||||
animation->spring.friction = 1150;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue