projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b452ba3
)
Close socket on error. Bug found by Coverity
author
Alan T. DeKok
<aland@freeradius.org>
Thu, 6 Sep 2012 09:18:15 +0000
(11:18 +0200)
committer
Alan T. DeKok
<aland@freeradius.org>
Thu, 6 Sep 2012 09:33:25 +0000
(11:33 +0200)
src/main/command.c
patch
|
blob
|
history
diff --git
a/src/main/command.c
b/src/main/command.c
index
0a06151
..
bd702a5
100644
(file)
--- a/
src/main/command.c
+++ b/
src/main/command.c
@@
-183,6
+183,7
@@
static int fr_server_domain_socket(const char *path)
if (errno != ENOENT) {
radlog(L_ERR, "Failed to stat %s: %s",
path, strerror(errno));
+ close(sockfd);
return -1;
}
@@
-196,6
+197,7
@@
static int fr_server_domain_socket(const char *path)
#endif
) {
radlog(L_ERR, "Cannot turn %s into socket", path);
+ close(sockfd);
return -1;
}
@@
-204,12
+206,14
@@
static int fr_server_domain_socket(const char *path)
*/
if (buf.st_uid != geteuid()) {
radlog(L_ERR, "We do not own %s", path);
+ close(sockfd);
return -1;
}
if (unlink(path) < 0) {
radlog(L_ERR, "Failed to delete %s: %s",
path, strerror(errno));
+ close(sockfd);
return -1;
}
}