You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
linux-capture: XComposite capture leaks an xcb error reply on every failed request #2053
ASan (run 40061643300, test_xcomposite_window_events) reports 36-byte leaks at:
xcomp_window_exists (xcomposite-input.c.h:78)
xcomp_create_pixmap (:339)
xcb_xcursor_offset_win (xcursor-xcb.c.h:129)
When a request fails (for example, the window is gone), xcb returns a malloc'd xcb_generic_error_t that the caller must free, and none of the three frees it. xcomp_window_exists runs on the safety-net round trip of every capture source, so a capture whose window has closed leaks one error each time it checks.
Fix: free the error in all three. Test: a new cmocka test calls the functions on a nonexistent window 1000 times and checks that the heap doesn't grow (mallinfo2).
Fixed by #2054 (merged). All five xcb error-reply sites in the XComposite capture now free their error. test_xcomposite_error_replies covers xcomp_window_exists and xcb_xcursor_offset_win; it failed with about 48 KB of growth per 1000 calls before the fix.
Activity
zackees commentedon Oct 24, 2026
Claiming: RED cmocka test + free the xcb errors. PR today.
fix(linux-capture): free the xcb error reply of failed X requests (ob…
zackees commentedon Oct 24, 2026
Fixed by #2054 (merged). All five xcb error-reply sites in the XComposite capture now free their error. test_xcomposite_error_replies covers xcomp_window_exists and xcb_xcursor_offset_win; it failed with about 48 KB of growth per 1000 calls before the fix.