summaryrefslogtreecommitdiff
path: root/present
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2016-08-08 17:25:35 +0200
committerAdam Jackson <ajax@redhat.com>2016-08-15 15:16:48 -0400
commitde5291c04b05772e6da599a475baa1b19dcae07a (patch)
tree8bcfbe41f29be976fdb645f985b729da9ae2d6af /present
parentd21b53673b9de052004e761fd1299d2e788b44b8 (diff)
present: Free the fake_present OsTimerPtr
Plug a leak in present_fake_queue_vblank() where the OsTimer would not be freed. 492,608 (482,816 direct, 9,792 indirect) bytes in 15,088 blocks are definitely lost in loss record 3,954 of 3,954 at 0x4C2ABDE: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x586B19: TimerSet (WaitFor.c:433) by 0x4F1AA9: present_fake_queue_vblank (present_fake.c:108) by 0x4F15E0: present_pixmap (present.c:954) by 0x4F23B4: proc_present_pixmap (present_request.c:138) by 0x552BCE: Dispatch (dispatch.c:430) by 0x556C22: dix_main (main.c:300) by 0x6F0D290: (below main) (in /usr/lib/libc-2.24.so) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97065 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'present')
-rw-r--r--present/present_fake.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/present/present_fake.c b/present/present_fake.c
index 4985c81e3..2350638ea 100644
--- a/present/present_fake.c
+++ b/present/present_fake.c
@@ -64,6 +64,7 @@ present_fake_do_timer(OsTimerPtr timer,
present_fake_notify(fake_vblank->screen, fake_vblank->event_id);
xorg_list_del(&fake_vblank->list);
+ TimerFree(fake_vblank->timer);
free(fake_vblank);
return 0;
}
@@ -75,7 +76,7 @@ present_fake_abort_vblank(ScreenPtr screen, uint64_t event_id, uint64_t msc)
xorg_list_for_each_entry_safe(fake_vblank, tmp, &fake_vblank_queue, list) {
if (fake_vblank->event_id == event_id) {
- TimerCancel(fake_vblank->timer);
+ TimerFree(fake_vblank->timer); /* TimerFree will call TimerCancel() */
xorg_list_del(&fake_vblank->list);
free (fake_vblank);
break;