From cd7812b4702493a95d62ad9ee413086ec7e248b9 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 5 Nov 2019 08:05:19 -0500 Subject: [PATCH] test: Handle NULL circuit pointer in new_fake_orcirc Coverity CID: 1455207 Closes #32376 Signed-off-by: David Goulet --- src/test/fakecircs.c | 4 ++++ 1 file changed, 4 insertions(+) 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);