]> git.meshlink.io Git - meshlink/commitdiff
Fix potential double free when using meshlink_add_invitation_address().
authorGuus Sliepen <guus@meshlink.io>
Tue, 10 Mar 2020 21:05:57 +0000 (22:05 +0100)
committerGuus Sliepen <guus@meshlink.io>
Tue, 10 Mar 2020 21:05:57 +0000 (22:05 +0100)
src/meshlink.c

index 9f9b771dc5589598df24ff18a7a06048199b161a..6e7cda60a3f71fd1a94424c754af48a1288ae0c5 100644 (file)
@@ -446,7 +446,7 @@ static char *get_my_hostname(meshlink_handle_t *mesh, uint32_t flags) {
 
                        if(colon) {
                                *colon = 0;
-                               port[n] = colon + 1;
+                               port[n] = xstrdup(colon + 1);
                        }
 
                        n++;