mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-08-09 09:51:49 +08:00
silence coverity
CID 530817: Resource leaks (RESOURCE_LEAK) Variable "ss" going out of scope leaks the storage "ss.ss_sp" points to. Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com>
This commit is contained in:
@@ -237,6 +237,7 @@ void ocsigaltstack(struct worker_st *ws)
|
||||
}
|
||||
if (mprotect(ss.ss_sp, SIGSTKSZ, PROT_READ | PROT_WRITE) == -1) {
|
||||
e = errno;
|
||||
free(ss.ss_sp);
|
||||
oclog(ws, LOG_ERR, "mprotect: %s\n", strerror(e));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@@ -244,6 +245,7 @@ void ocsigaltstack(struct worker_st *ws)
|
||||
ss.ss_flags = 0;
|
||||
if (sigaltstack(&ss, NULL) == -1) {
|
||||
e = errno;
|
||||
free(ss.ss_sp);
|
||||
oclog(ws, LOG_ERR, "sigaltstack: %s\n", strerror(e));
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user