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

diff --git a/modules/im/ximcp/imLcIm.c b/modules/im/ximcp/imLcIm.c
index 83f216a..9041698 100644
--- a/modules/im/ximcp/imLcIm.c
+++ b/modules/im/ximcp/imLcIm.c
@@ -489,10 +489,13 @@ _XimWriteCachedDefaultTree(
 
     /* This STILL might be racy on NFS */
     if ( (fd = _XOpenFileMode (cachename, O_WRONLY | O_CREAT | O_EXCL,
-                              0600)) < 0)
+                              0600)) < 0) {
+       Xfree(m);
        return;
+    }
     if (! (fp = fdopen (fd, "wb")) ) {
        close (fd);
+       Xfree(m);
        return;
     }
     fwrite (m, msize, 1, fp);
-- 
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