[tor-commits] [tor/master] test: Handle NULL circuit pointer in new_fake_orcirc
nickm at torproject.org
nickm at torproject.org
Tue Nov 5 13:08:45 UTC 2019
commit cd7812b4702493a95d62ad9ee413086ec7e248b9
Author: David Goulet <dgoulet at torproject.org>
Date: Tue Nov 5 08:05:19 2019 -0500
test: Handle NULL circuit pointer in new_fake_orcirc
Coverity CID: 1455207
Closes #32376
Signed-off-by: David Goulet <dgoulet at torproject.org>
---
src/test/fakecircs.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/test/fakecircs.c b/src/test/fakecircs.c
index 62027e033..82a8722ba 100644
--- a/src/test/fakecircs.c
+++ b/src/test/fakecircs.c
@@ -71,6 +71,10 @@ new_fake_orcirc(channel_t *nchan, channel_t *pchan)
void
free_fake_orcirc(or_circuit_t *orcirc)
{
+ if (!orcirc) {
+ return;
+ }
+
circuit_t *circ = TO_CIRCUIT(orcirc);
relay_crypto_clear(&orcirc->crypto);
More information about the tor-commits
mailing list