summaryrefslogtreecommitdiffstats
path: root/tdm
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2017-03-25 17:33:22 +0100
committerSlávek Banko <slavek.banko@axis.cz>2017-03-25 17:33:22 +0100
commitba2fe631679775cc5e25fe0e7b9769e7bc0e0f68 (patch)
tree5fd8e757de0acdf3a5c7b01f2e342b7f11886f48 /tdm
parentec82c436506fd65e1acb3ebdfe8661b9682f4f8f (diff)
downloadtdebase-ba2fe631679775cc5e25fe0e7b9769e7bc0e0f68.tar.gz
tdebase-ba2fe631679775cc5e25fe0e7b9769e7bc0e0f68.zip
Fix memory leak after use XGetAtomName
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdm')
-rw-r--r--tdm/kfrontend/tdm_greet.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tdm/kfrontend/tdm_greet.c b/tdm/kfrontend/tdm_greet.c
index 5c77fadf..6f8c84ca 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;
}