From ba2fe631679775cc5e25fe0e7b9769e7bc0e0f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 25 Mar 2017 17:33:22 +0100 Subject: Fix memory leak after use XGetAtomName MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdm/kfrontend/tdm_greet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tdm/kfrontend') diff --git a/tdm/kfrontend/tdm_greet.c b/tdm/kfrontend/tdm_greet.c index 5c77fadf0..6f8c84caf 100644 --- a/tdm/kfrontend/tdm_greet.c +++ b/tdm/kfrontend/tdm_greet.c @@ -568,11 +568,16 @@ xkb_modifier_mask_work( XkbDescPtr xkb, const char *name ) return 0; for (i = 0; i < XkbNumVirtualMods; i++) { char *modStr = XGetAtomName( xkb->dpy, xkb->names->vmods[i] ); - if (modStr != NULL && strcmp( name, modStr ) == 0) { + if( modStr == NULL ) { + continue; + } + if( strcmp( name, modStr ) == 0 ) { unsigned int mask; XkbVirtualModsToReal( xkb, 1 << i, &mask ); + XFree(modStr); return mask; } + XFree(modStr); } return 0; } -- cgit v1.2.1