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:
Dimitri Papadopoulos
2025-01-14 15:30:51 +01:00
parent d425d1749c
commit bab0561111
+2
View File
@@ -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);
}