diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-12-11 16:25:04 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-12-11 16:25:04 -0500 |
commit | 418d8bbe92bf31861ad2aaf787f00d20c7179c1e (patch) | |
tree | 5281ce70aca2d11766713431b40593e14edb0798 /src/or | |
parent | 057139d3830bb94df8031bb6e8e385cef53352bc (diff) | |
parent | 35d56a127d9af913f0f74ec359b182fa33f49c50 (diff) | |
download | tor-418d8bbe92bf31861ad2aaf787f00d20c7179c1e.tar.gz tor-418d8bbe92bf31861ad2aaf787f00d20c7179c1e.zip |
Merge branch 'stack_fixes_032_v2' into maint-0.3.2
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/rephist.c | 4 | ||||
-rw-r--r-- | src/or/transports.c | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index 87b5a93713..345722d8ce 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -1811,7 +1811,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 @@ -1821,6 +1821,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 68d1354844..5fb24e11a0 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); |