Merge branch 'tmp-coverity-fixes' into 'master'

Include fixes identified by coverity

See merge request openconnect/ocserv!260
This commit is contained in:
Nikos Mavrogiannopoulos
2021-04-02 18:56:09 +00:00
3 changed files with 6 additions and 3 deletions

View File

@@ -112,7 +112,7 @@ void set_self_oom_score_adj(main_server_st * s)
}
cleanup:
if (fd) {
if (fd >= 0) {
close(fd);
}
#endif
@@ -181,4 +181,5 @@ void drop_privileges(main_server_st * s)
mslog(s, NULL, LOG_ERR, "cannot enforce NPROC limit: %s\n",
strerror(e));
}
}
}

View File

@@ -147,6 +147,7 @@ int ctl_handler_init(main_server_st * s)
e = errno;
mslog(s, NULL, LOG_ERR, "could not bind socket '%s': %s",
GETPCONFIG(s)->occtl_socket_file, strerror(e));
close(sd);
return -1;
}
@@ -162,6 +163,7 @@ int ctl_handler_init(main_server_st * s)
e = errno;
mslog(s, NULL, LOG_ERR, "could not listen to socket '%s': %s",
GETPCONFIG(s)->occtl_socket_file, strerror(e));
close(sd);
return -1;
}

View File

@@ -733,7 +733,7 @@ void session_list(struct unix_ctx *ctx, SecmListCookiesReplyMsg *rep, FILE *out,
{
unsigned i;
const char *username;
char tmpbuf[MAX_TMPSTR_SIZE];
char tmpbuf[MAX_TMPSTR_SIZE] = "";
time_t t;
struct tm *tm, _tm;
char str_since[65];