[Xcb-commit] src

Julien Danjou jdanjou at kemper.freedesktop.org
Thu Jan 7 09:03:49 PST 2010


 src/xcb_conn.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit be7e528eae62ddee14fa50f2c0e9036bafbc9f81
Author: Rémi Denis-Courmont <remi at remlab.net>
Date:   Thu Jan 7 18:08:35 2010 +0200

    xcb_connect_to_fd: fix descriptor leak on memory error path
    
    Signed-off-by: Julien Danjou <julien at danjou.info>

diff --git a/src/xcb_conn.c b/src/xcb_conn.c
index 251d62e..ed2153d 100644
--- a/src/xcb_conn.c
+++ b/src/xcb_conn.c
@@ -211,8 +211,10 @@ xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info)
     xcb_connection_t* c;
 
     c = calloc(1, sizeof(xcb_connection_t));
-    if(!c)
+    if(!c) {
+        close(fd);
         return (xcb_connection_t *) &error_connection;
+    }
 
     c->fd = fd;
 


More information about the xcb-commit mailing list