1*4882a593SmuzhiyunFrom 8a368d808fec166b5fb3dfe6312aab22c7ee20af Mon Sep 17 00:00:00 2001 2*4882a593SmuzhiyunFrom: Hodong <hodong@yozmos.com> 3*4882a593SmuzhiyunDate: Thu, 20 Jan 2022 00:57:41 +0900 4*4882a593SmuzhiyunSubject: [PATCH] Fix two memory leaks in _XFreeX11XCBStructure() 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunUpstream-Status: Backport [https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/8a368d808fec166b5fb3dfe6312aab22c7ee20af] 7*4882a593SmuzhiyunCVE: CVE-2022-3555 8*4882a593SmuzhiyunSigned-off-by: Hitendra Prajapati <hprajapati@mvista.com> 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunFix two memory leaks in _XFreeX11XCBStructure() 11*4882a593Smuzhiyun 12*4882a593SmuzhiyunEven when XCloseDisplay() was called, some memory was leaked. 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunXCloseDisplay() calls _XFreeDisplayStructure(), which calls 15*4882a593Smuzhiyun_XFreeX11XCBStructure(). 16*4882a593Smuzhiyun 17*4882a593SmuzhiyunHowever, _XFreeX11XCBStructure() did not destroy the condition variables, 18*4882a593Smuzhiyunresulting in the leaking of some 40 bytes. 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunSigned-off-by: default avatarHodong <hodong@yozmos.com> 21*4882a593Smuzhiyun--- 22*4882a593Smuzhiyun src/xcb_disp.c | 2 ++ 23*4882a593Smuzhiyun 1 file changed, 2 insertions(+) 24*4882a593Smuzhiyun 25*4882a593Smuzhiyundiff --git a/src/xcb_disp.c b/src/xcb_disp.c 26*4882a593Smuzhiyunindex 70a602f..e9becee 100644 27*4882a593Smuzhiyun--- a/src/xcb_disp.c 28*4882a593Smuzhiyun+++ b/src/xcb_disp.c 29*4882a593Smuzhiyun@@ -102,6 +102,8 @@ void _XFreeX11XCBStructure(Display *dpy) 30*4882a593Smuzhiyun dpy->xcb->pending_requests = tmp->next; 31*4882a593Smuzhiyun free(tmp); 32*4882a593Smuzhiyun } 33*4882a593Smuzhiyun+ xcondition_clear(dpy->xcb->event_notify); 34*4882a593Smuzhiyun+ xcondition_clear(dpy->xcb->reply_notify); 35*4882a593Smuzhiyun xcondition_free(dpy->xcb->event_notify); 36*4882a593Smuzhiyun xcondition_free(dpy->xcb->reply_notify); 37*4882a593Smuzhiyun Xfree(dpy->xcb); 38*4882a593Smuzhiyun-- 39*4882a593Smuzhiyun2.25.1 40*4882a593Smuzhiyun 41