Fix issues found by Coverity.
[tinc] / src / net.c
index fd79fdc..60f46cb 100644 (file)
--- a/src/net.c
+++ b/src/net.c
@@ -186,6 +186,12 @@ void terminate_connection(connection_t *c, bool report) {
                closesocket(c->socket);
 
        if(c->edge) {
+               if(!c->node) {
+                       logger(LOG_ERR, "Connection to %s (%s) has an edge but node is NULL!", c->name, c->hostname);
+                       // And that should never happen.
+                       abort();
+               }
+
                if(report && !tunnelserver)
                        send_del_edge(everyone, c->edge);