summaryrefslogtreecommitdiff
path: root/src/test/fakecircs.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-11-05 08:05:19 -0500
committerDavid Goulet <dgoulet@torproject.org>2019-11-05 08:05:22 -0500
commitcd7812b4702493a95d62ad9ee413086ec7e248b9 (patch)
tree3dfc895c6b6fe36052926beb961ae9d5d0de7a44 /src/test/fakecircs.c
parent60d5ff303d65bb7caf5c064675c661faac4cecf1 (diff)
downloadtor-cd7812b4702493a95d62ad9ee413086ec7e248b9.tar.gz
tor-cd7812b4702493a95d62ad9ee413086ec7e248b9.zip
test: Handle NULL circuit pointer in new_fake_orcirc
Coverity CID: 1455207 Closes #32376 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/fakecircs.c')
-rw-r--r--src/test/fakecircs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/fakecircs.c b/src/test/fakecircs.c
index 62027e0339..82a8722ba8 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);