projects
/
lttng-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
031f232
)
Fix: fd leak in inet accept call
author
David Goulet
<dgoulet@efficios.com>
Tue, 30 Sep 2014 15:59:49 +0000
(11:59 -0400)
committer
David Goulet
<dgoulet@efficios.com>
Tue, 30 Sep 2014 15:59:49 +0000
(11:59 -0400)
Fixes Coverity issue #
1241799
.
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/sessiond-comm/inet.c
patch
|
blob
|
blame
|
history
diff --git
a/src/common/sessiond-comm/inet.c
b/src/common/sessiond-comm/inet.c
index cf06ecb858d2079455c7a009f888435b6532d6c4..32a16a690342976a68c4d84f6e5c94abd7ad6d14 100644
(file)
--- a/
src/common/sessiond-comm/inet.c
+++ b/
src/common/sessiond-comm/inet.c
@@
-305,11
+305,11
@@
struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
ret = lttcomm_setsockopt_rcv_timeout(new_fd, timeout);
if (ret) {
- goto error;
+ goto error
_close
;
}
ret = lttcomm_setsockopt_snd_timeout(new_fd, timeout);
if (ret) {
- goto error;
+ goto error
_close
;
}
}
@@
-319,6
+319,11
@@
struct lttcomm_sock *lttcomm_accept_inet_sock(struct lttcomm_sock *sock)
end:
return new_sock;
+error_close:
+ if (close(new_fd) < 0) {
+ PERROR("accept inet close fd");
+ }
+
error:
free(new_sock);
return NULL;
This page took
0.026179 seconds
and
4
git commands to generate.