Found by parfait 1.1 code analyser:
   Memory leak of pointer 'keymap' allocated with 
XGetKeyboardMapping(HostX.dpy, min_keycode, ((max_keycode - min_keycode) + 1), 
&host_width)
        at line 861 of hw/kdrive/ephyr/hostx.c in function 'hostx_load_keymap'.
          'keymap' allocated at line 845 with XGetKeyboardMapping(HostX.dpy, 
min_keycode, ((max_keycode - min_keycode) + 1), &host_width).

Signed-off-by: Alan Coopersmith <[email protected]>
---
 hw/kdrive/ephyr/hostx.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 157ac36..aed0285 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -858,7 +858,7 @@ hostx_load_keymap(void)
                                          (max_keycode - min_keycode + 1) *
                                          width);
     if (!ephyrKeySyms.map)
-        return;
+        goto out;
 
     for (i = 0; i < (max_keycode - min_keycode + 1); i++)
         for (j = 0; j < width; j++)
@@ -871,6 +871,7 @@ hostx_load_keymap(void)
     ephyrKeySyms.maxKeyCode = max_keycode;
     ephyrKeySyms.mapWidth = width;
 
+ out:
     XFree(keymap);
 }
 
-- 
1.7.9.2

_______________________________________________
[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