scan-build: fix a crash-on-fail possibility in test_policy.c

This commit is contained in:
Nick Mathewson 2014-04-18 20:33:21 -04:00
parent 0fd0f5f7a9
commit 69ea4450ca

View File

@ -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);
}