summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-11 16:43:51 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-11 16:43:51 -0500
commitd5400d50e7ff0fe251c095ea7f29a82cd1045031 (patch)
tree5556a9e742ccc9452f055634d4c801f82329096d /src
parent252db6ad26900235f8904fa6b8d510551b9176cf (diff)
parentacc462c965acb90c2631797e10bb630eb2789e4e (diff)
downloadtor-d5400d50e7ff0fe251c095ea7f29a82cd1045031.tar.gz
tor-d5400d50e7ff0fe251c095ea7f29a82cd1045031.zip
Merge branch 'maint-0.3.2'
Diffstat (limited to 'src')
-rw-r--r--src/common/sandbox.c25
-rw-r--r--src/or/rephist.c4
-rw-r--r--src/or/transports.c4
3 files changed, 3 insertions, 30 deletions
diff --git a/src/common/sandbox.c b/src/common/sandbox.c
index c5936f4030..84c46dcb05 100644
--- a/src/common/sandbox.c
+++ b/src/common/sandbox.c
@@ -1394,10 +1394,6 @@ sandbox_cfg_allow_stat_filename(sandbox_cfg_t **cfg, char *file)
sandbox_cfg_t *elem = NULL;
elem = new_element(SCMP_stat, file);
- if (!elem) {
- log_err(LD_BUG,"(Sandbox) failed to register parameter!");
- return -1;
- }
elem->next = *cfg;
*cfg = elem;
@@ -1411,10 +1407,6 @@ sandbox_cfg_allow_open_filename(sandbox_cfg_t **cfg, char *file)
sandbox_cfg_t *elem = NULL;
elem = new_element(SCMP_SYS(open), file);
- if (!elem) {
- log_err(LD_BUG,"(Sandbox) failed to register parameter!");
- return -1;
- }
elem->next = *cfg;
*cfg = elem;
@@ -1428,10 +1420,6 @@ sandbox_cfg_allow_chmod_filename(sandbox_cfg_t **cfg, char *file)
sandbox_cfg_t *elem = NULL;
elem = new_element(SCMP_SYS(chmod), file);
- if (!elem) {
- log_err(LD_BUG,"(Sandbox) failed to register parameter!");
- return -1;
- }
elem->next = *cfg;
*cfg = elem;
@@ -1445,10 +1433,6 @@ sandbox_cfg_allow_chown_filename(sandbox_cfg_t **cfg, char *file)
sandbox_cfg_t *elem = NULL;
elem = new_element(SCMP_SYS(chown), file);
- if (!elem) {
- log_err(LD_BUG,"(Sandbox) failed to register parameter!");
- return -1;
- }
elem->next = *cfg;
*cfg = elem;
@@ -1463,11 +1447,6 @@ sandbox_cfg_allow_rename(sandbox_cfg_t **cfg, char *file1, char *file2)
elem = new_element2(SCMP_SYS(rename), file1, file2);
- if (!elem) {
- log_err(LD_BUG,"(Sandbox) failed to register parameter!");
- return -1;
- }
-
elem->next = *cfg;
*cfg = elem;
@@ -1480,10 +1459,6 @@ sandbox_cfg_allow_openat_filename(sandbox_cfg_t **cfg, char *file)
sandbox_cfg_t *elem = NULL;
elem = new_element(SCMP_SYS(openat), file);
- if (!elem) {
- log_err(LD_BUG,"(Sandbox) failed to register parameter!");
- return -1;
- }
elem->next = *cfg;
*cfg = elem;
diff --git a/src/or/rephist.c b/src/or/rephist.c
index de4635ee59..15fb674fff 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -1814,7 +1814,7 @@ static time_t last_prediction_add_time=0;
int
predicted_ports_prediction_time_remaining(time_t now)
{
- time_t idle_delta = now - last_prediction_add_time;
+ time_t idle_delta;
/* Protect against overflow of return value. This can happen if the clock
* jumps backwards in time. Update the last prediction time (aka last
@@ -1824,6 +1824,8 @@ predicted_ports_prediction_time_remaining(time_t now)
if (last_prediction_add_time > now) {
last_prediction_add_time = now;
idle_delta = 0;
+ } else {
+ idle_delta = now - last_prediction_add_time;
}
/* Protect against underflow of the return value. This can happen for very
diff --git a/src/or/transports.c b/src/or/transports.c
index 04b24b0f81..1e6307b7d0 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -1094,8 +1094,6 @@ parse_smethod_line(const char *line, managed_proxy_t *mp)
transport = transport_new(&tor_addr, port, method_name,
PROXY_NONE, args_string);
- if (!transport)
- goto err;
smartlist_add(mp->transports, transport);
@@ -1186,8 +1184,6 @@ parse_cmethod_line(const char *line, managed_proxy_t *mp)
}
transport = transport_new(&tor_addr, port, method_name, socks_ver, NULL);
- if (!transport)
- goto err;
smartlist_add(mp->transports, transport);