aboutsummaryrefslogtreecommitdiff
path: root/src/or/policies.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-01-14 19:00:23 +0000
committerNick Mathewson <nickm@torproject.org>2008-01-14 19:00:23 +0000
commit3b8f76aa512338ec91104240d28d8f32246b5eb6 (patch)
treea0cfda3a8a0007ecea1bfaa242e7f5d1eda378e3 /src/or/policies.c
parente49229caf8645564646354c6f3670db2cab26583 (diff)
downloadtor-3b8f76aa512338ec91104240d28d8f32246b5eb6.tar.gz
tor-3b8f76aa512338ec91104240d28d8f32246b5eb6.zip
r17611@catbus: nickm | 2008-01-14 13:44:16 -0500
add some missing checks for failing return values. svn:r13130
Diffstat (limited to 'src/or/policies.c')
-rw-r--r--src/or/policies.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/policies.c b/src/or/policies.c
index f4b52e93dc..17d0f9c25c 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -332,11 +332,12 @@ static void
load_policy_from_option(config_line_t *config, smartlist_t **policy,
int assume_action)
{
+ int r;
addr_policy_list_free(*policy);
*policy = NULL;
- parse_addr_policy(config, policy, assume_action);
- if (!*policy)
- return;
+ r = parse_addr_policy(config, policy, assume_action);
+ if (r < 0 || !*policy)
+ return; /* XXXX020 have an error return. */
SMARTLIST_FOREACH(*policy, addr_policy_t *, n, {
/* ports aren't used. */
n->prt_min = 1;
@@ -598,7 +599,9 @@ append_exit_policy_string(smartlist_t **policy, const char *more)
tmp.key = NULL;
tmp.value = (char*) more;
tmp.next = NULL;
- parse_addr_policy(&tmp, policy, -1);
+ if (parse_addr_policy(&tmp, policy, -1)<0) {
+ log_warn(LD_BUG, "Unable to parse internally generated policy %s",more);
+ }
}
/** Detect and excise "dead code" from the policy *<b>dest</b>. */