summaryrefslogtreecommitdiffstats
path: root/tdekbdledsync/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdekbdledsync/main.cpp')
-rw-r--r--tdekbdledsync/main.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/tdekbdledsync/main.cpp b/tdekbdledsync/main.cpp
index 42bb6c9df..0f4075694 100644
--- a/tdekbdledsync/main.cpp
+++ b/tdekbdledsync/main.cpp
@@ -193,11 +193,16 @@ unsigned int xkb_mask_modifier(XkbDescPtr xkb, const char *name) {
}
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;
}