aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-08-21 11:40:48 -0400
committerNick Mathewson <nickm@torproject.org>2014-08-21 11:40:48 -0400
commit523587a5cf62119baa01822e2e783925726a790b (patch)
treeb2ea640cf66dff29384314784c03577f19dfcd61 /src/common
parent35b2e11755627cdd9b746f150ccdbecbcc867f0d (diff)
downloadtor-523587a5cf62119baa01822e2e783925726a790b.tar.gz
tor-523587a5cf62119baa01822e2e783925726a790b.zip
fix memory leak on failure in sandbox.c:prot_strings()
[CID 1205014]
Diffstat (limited to 'src/common')
-rw-r--r--src/common/sandbox.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index 86dc56c5aa..e735feb018 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -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));
if (ret) {
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));
if (ret) {
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),
@@ -1113,7 +1113,7 @@ prot_strings(scmp_filter_ctx ctx, sandbox_cfg_t* cfg)
SCMP_CMP(2, SCMP_CMP_EQ, PROT_READ|PROT_WRITE));
if (ret) {
log_err(LD_BUG,"(Sandbox) mprotect protected memory filter fail (GT)!");
- return ret;
+ goto out;
}
out: