[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] test: Handle NULL circuit pointer in new_fake_orcirc



commit cd7812b4702493a95d62ad9ee413086ec7e248b9
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxx>
---
 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);



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits