diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-18 20:33:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-18 20:33:21 -0400 |
commit | 69ea4450caee65be56912fd2618c2b95413a0763 (patch) | |
tree | 91126e2bf1c61855351b29089cbd5a2fb83724fd /src | |
parent | 0fd0f5f7a9309fb90a6a4d8bad7d6399a45c7cc1 (diff) | |
download | tor-69ea4450caee65be56912fd2618c2b95413a0763.tar.gz tor-69ea4450caee65be56912fd2618c2b95413a0763.zip |
scan-build: fix a crash-on-fail possibility in test_policy.c
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test_policy.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/test_policy.c b/src/test/test_policy.c index d2ba1612de..491c9a21fb 100644 --- a/src/test/test_policy.c +++ b/src/test/test_policy.c @@ -417,8 +417,10 @@ test_dump_exit_policy_to_string(void *arg) done: - SMARTLIST_FOREACH(ri->exit_policy, addr_policy_t *, - entry, addr_policy_free(entry)); + if (ri->exit_policy) { + SMARTLIST_FOREACH(ri->exit_policy, addr_policy_t *, + entry, addr_policy_free(entry)); + } tor_free(ri); tor_free(ep); } |