mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 06:13:31 +01:00
fix memory leak on failure in sandbox.c:prot_strings()
[CID 1205014]
This commit is contained in:
parent
35b2e11755
commit
523587a5cf
@ -1084,7 +1084,7 @@ prot_strings(scmp_filter_ctx ctx, sandbox_cfg_t* cfg)
|
|||||||
SCMP_CMP(0, SCMP_CMP_EQ, (intptr_t) pr_mem_base));
|
SCMP_CMP(0, SCMP_CMP_EQ, (intptr_t) pr_mem_base));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
log_err(LD_BUG,"(Sandbox) munmap protected memory filter fail!");
|
log_err(LD_BUG,"(Sandbox) munmap protected memory filter fail!");
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1103,7 +1103,7 @@ prot_strings(scmp_filter_ctx ctx, sandbox_cfg_t* cfg)
|
|||||||
SCMP_CMP(2, SCMP_CMP_EQ, PROT_READ|PROT_WRITE));
|
SCMP_CMP(2, SCMP_CMP_EQ, PROT_READ|PROT_WRITE));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
log_err(LD_BUG,"(Sandbox) mprotect protected memory filter fail (LT)!");
|
log_err(LD_BUG,"(Sandbox) mprotect protected memory filter fail (LT)!");
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = seccomp_rule_add_3(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect),
|
ret = seccomp_rule_add_3(ctx, SCMP_ACT_ALLOW, SCMP_SYS(mprotect),
|
||||||
@ -1113,7 +1113,7 @@ prot_strings(scmp_filter_ctx ctx, sandbox_cfg_t* cfg)
|
|||||||
SCMP_CMP(2, SCMP_CMP_EQ, PROT_READ|PROT_WRITE));
|
SCMP_CMP(2, SCMP_CMP_EQ, PROT_READ|PROT_WRITE));
|
||||||
if (ret) {
|
if (ret) {
|
||||||
log_err(LD_BUG,"(Sandbox) mprotect protected memory filter fail (GT)!");
|
log_err(LD_BUG,"(Sandbox) mprotect protected memory filter fail (GT)!");
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
Loading…
Reference in New Issue
Block a user