Release modifiermap before returning

Reviewed-by: Ander Conselvan de Oliveira <[email protected]>
Signed-off-by: Erkki Seppälä <[email protected]>
---
 modules/im/ximcp/imThaiFlt.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/im/ximcp/imThaiFlt.c b/modules/im/ximcp/imThaiFlt.c
index e0b3988..ca8c601 100644
--- a/modules/im/ximcp/imThaiFlt.c
+++ b/modules/im/ximcp/imThaiFlt.c
@@ -1268,9 +1268,12 @@ NumLockMask(Display *d)
         return 0;
 
     for (i = 0; i < 8; i++) {
-        if (map->modifiermap[map->max_keypermod * i] == numlock_keycode)
+        if (map->modifiermap[map->max_keypermod * i] == numlock_keycode) {
+            XFreeModifiermap(map);
             return 1 << i;
+        }
     }
+    XFreeModifiermap(map);
     return 0;
 }
 
-- 
1.7.0.4

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to