projects
/
platform
/
upstream
/
libxcb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c7a5704
)
xcb_connect_to_fd: fix descriptor leak on memory error path
author
Rémi Denis-Courmont
<remi@remlab.net>
Thu, 7 Jan 2010 16:08:35 +0000
(18:08 +0200)
committer
Julien Danjou
<julien@danjou.info>
Thu, 7 Jan 2010 17:03:30 +0000
(18:03 +0100)
Signed-off-by: Julien Danjou <julien@danjou.info>
src/xcb_conn.c
patch
|
blob
|
history
diff --git
a/src/xcb_conn.c
b/src/xcb_conn.c
index
251d62e
..
ed2153d
100644
(file)
--- 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;