aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTaylor Yu <catalyst@torproject.org>2017-05-01 14:00:06 -0400
committerTaylor Yu <catalyst@torproject.org>2017-05-02 16:12:30 -0400
commit5494087ed76475d30d80b47205cf8a0c5fb8ea69 (patch)
treec1ae5db5fa0cf7758f368d2faca6841097da6ab2 /src
parentfd437f2a0259e60379fbfe9b8bf6ee1e8fb1eae6 (diff)
downloadtor-5494087ed76475d30d80b47205cf8a0c5fb8ea69.tar.gz
tor-5494087ed76475d30d80b47205cf8a0c5fb8ea69.zip
Delete useless checks in confparse.c
config_parse_interval() and config_parse_msec_interval() were checking whether the variable "ok" (a pointer to an int) was null, rather than derefencing it. Both functions are static, and all existing callers pass a valid pointer to those static functions. The callers do check the variables (also confusingly named "ok") whose addresses they pass as the "ok" arguments, so even if the pointer check were corrected to be a dereference, it would be redundant. Fixes #22103.
Diffstat (limited to 'src')
-rw-r--r--src/or/confparse.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/or/confparse.c b/src/or/confparse.c
index 75ec92e30f..abae7e33dc 100644
--- a/src/or/confparse.c
+++ b/src/or/confparse.c
@@ -1190,8 +1190,6 @@ config_parse_msec_interval(const char *s, int *ok)
{
uint64_t r;
r = config_parse_units(s, time_msec_units, ok);
- if (!ok)
- return -1;
if (r > INT_MAX) {
log_warn(LD_CONFIG, "Msec interval '%s' is too long", s);
*ok = 0;
@@ -1209,8 +1207,6 @@ config_parse_interval(const char *s, int *ok)
{
uint64_t r;
r = config_parse_units(s, time_units, ok);
- if (!ok)
- return -1;
if (r > INT_MAX) {
log_warn(LD_CONFIG, "Interval '%s' is too long", s);
*ok = 0;