aboutsummaryrefslogtreecommitdiff
path: root/libX11/modules/im/ximcp/imLcIm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/modules/im/ximcp/imLcIm.c')
-rw-r--r--libX11/modules/im/ximcp/imLcIm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libX11/modules/im/ximcp/imLcIm.c b/libX11/modules/im/ximcp/imLcIm.c
index 430e318d2..44516e9ee 100644
--- a/libX11/modules/im/ximcp/imLcIm.c
+++ b/libX11/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);