Commit b7cc762b authored by Ander Conselvan de Oliveira's avatar Ander Conselvan de Oliveira Committed by Ulrich Sibiller

Fix memory leaks on _XimWriteCachedDefaultTree error paths.

parent 7024f3d9
......@@ -491,10 +491,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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment