projects
/
paraslash.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0463f2b
)
Fix an fd leak in udp_send.c.
author
Andre Noll
<maan@systemlinux.org>
Sat, 10 Jan 2009 15:52:54 +0000
(16:52 +0100)
committer
Andre Noll
<maan@systemlinux.org>
Sat, 10 Jan 2009 15:52:54 +0000
(16:52 +0100)
In case mark_fd_nonblocking() fails, the old code leaks an open fd.
udp_send.c
patch
|
blob
|
history
diff --git
a/udp_send.c
b/udp_send.c
index 9e03b402fe18d2a9d0584c2653a8d7baeb78af35..50161c1333642d2021b47c3b0a05ff4bd43f10f6 100644
(file)
--- a/
udp_send.c
+++ b/
udp_send.c
@@
-84,7
+84,10
@@
static int udp_init_session(struct udp_target *ut)
if (ret < 0)
return ret;
ut->fd = ret;
- return mark_fd_nonblocking(ut->fd);
+ ret = mark_fd_nonblocking(ut->fd);
+ if (ret < 0)
+ close(ut->fd);
+ return ret;
}
static void udp_shutdown_targets(void)