aboutsummaryrefslogtreecommitdiff
path: root/libxcb/src/xcb_conn.c
diff options
context:
space:
mode:
Diffstat (limited to 'libxcb/src/xcb_conn.c')
-rw-r--r--libxcb/src/xcb_conn.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libxcb/src/xcb_conn.c b/libxcb/src/xcb_conn.c
index 251d62e01..ed2153d27 100644
--- a/libxcb/src/xcb_conn.c
+++ b/libxcb/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;