xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Mon Aug 15 19:18:06 UTC 2016


 present/present_fake.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit de5291c04b05772e6da599a475baa1b19dcae07a
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Mon Aug 8 17:25:35 2016 +0200

    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 at redhat.com>
    Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

diff --git a/present/present_fake.c b/present/present_fake.c
index 4985c81..2350638 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;


More information about the xorg-commit mailing list