X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Ftrio.c;h=41aa4fb6215795ae736a41e745414bcfe89dc5f2;hb=9e8e77dba3462c4a7f7e758ade4d16bc669fc4a7;hp=522020fe1d07bbe61d3811095d6fdf7278871ad1;hpb=5a8c20cfd63b480e94101f7333e871511a92fd37;p=meshlink diff --git a/test/trio.c b/test/trio.c index 522020fe..41aa4fb6 100644 --- a/test/trio.c +++ b/test/trio.c @@ -1,6 +1,7 @@ #define _GNU_SOURCE #include +#include #include #include #include @@ -52,14 +53,12 @@ int main() { char *data[3]; for(int i = 0; i < 3; i++) { - char *path; - int ret_val; - (void)ret_val; - ret_val = asprintf(&path, "trio_conf.%d", i); - assert(path); + char *path = NULL; + assert(asprintf(&path, "trio_conf.%d", i) != -1 && path); mesh[i] = meshlink_open(path, name[i], "trio", DEV_CLASS_BACKBONE); assert(mesh[i]); + free(path); meshlink_add_address(mesh[i], "localhost"); @@ -85,6 +84,7 @@ int main() { // start the nodes for(int i = 0; i < 3; i++) { + free(data[i]); assert(meshlink_start(mesh[i])); } @@ -103,6 +103,7 @@ int main() { devtool_edge_t *edges = NULL; size_t nedges = 0; assert_after((edges = devtool_get_all_edges(mesh[1], edges, &nedges), nedges == 3), 15); + free(edges); // Stop the first node