From 2da6d5f76f0aadb51b4e5f8c09bde561da8f249c Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 3 Jan 2012 13:27:41 +0200 Subject: [PATCH] compositor: fix use after free in wlsc_zoom_frame Add the missing return statement, so the destroyed zoom object is not used. Found by Valgrind. Signed-off-by: Pekka Paalanen --- compositor/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compositor/util.c b/compositor/util.c index 4ce1774e..6d6c0c95 100644 --- a/compositor/util.c +++ b/compositor/util.c @@ -189,8 +189,10 @@ wlsc_zoom_frame(struct wlsc_animation *animation, wlsc_spring_update(&zoom->spring, msecs); - if (wlsc_spring_done(&zoom->spring)) + if (wlsc_spring_done(&zoom->spring)) { wlsc_zoom_destroy(zoom); + return; + } scale = zoom->start + (zoom->stop - zoom->start) * zoom->spring.current;