]> git.meshlink.io Git - meshlink/blobdiff - src/protocol_misc.c
Fix potential segmentation fault on iOS.
[meshlink] / src / protocol_misc.c
index af3caddf8957f38006a540ddc331cfe0823efcdd..c6a3630ae2ea190fc27ee41dbe8b9206c85591b9 100644 (file)
@@ -109,17 +109,8 @@ bool pong_h(meshlink_handle_t *mesh, connection_t *c, const char *request) {
 
        /* Successful connection, reset timeout if this is an outgoing connection. */
 
-       // TODO: completely remove this outgoing, let the autoconnect algorithm handle it
        if(c->outgoing) {
-               c->outgoing->timeout = 0;
-               c->outgoing->state = OUTGOING_START;
-
-               if(c->outgoing->ai) {
-                       freeaddrinfo(c->outgoing->ai);
-               }
-
-               c->outgoing->ai = NULL;
-               c->outgoing->aip = NULL;
+               reset_outgoing(c->outgoing);
        }
 
        return true;