X-Git-Url: http://git.meshlink.io/?p=meshlink;a=blobdiff_plain;f=test%2Ftrio.c;h=41aa4fb6215795ae736a41e745414bcfe89dc5f2;hp=1dc33aa4480756f229c5fb275896e22c2ec4d9ff;hb=9e8e77dba3462c4a7f7e758ade4d16bc669fc4a7;hpb=771c923ba3d6e2122d822cd1ebd38373020dc422 diff --git a/test/trio.c b/test/trio.c index 1dc33aa4..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"); @@ -104,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