X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=test%2Ftrio2.c;h=b55fde7348fbe5a256114996ccb30b17c00d8d77;hb=9cde0d32cf209388cc59b06b7dcb0c3432f97da5;hp=d9b3a0f94454cf9ec58eeba0194d275ed7e42830;hpb=6354733cc5044c5226c430d97262c06ab4cd0d5e;p=meshlink diff --git a/test/trio2.c b/test/trio2.c index d9b3a0f9..b55fde73 100644 --- a/test/trio2.c +++ b/test/trio2.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, "trio2_conf.%d", i); - assert(path); + char *path = NULL; + assert(asprintf(&path, "trio2_conf.%d", i) != -1 && path); mesh[i] = meshlink_open(path, name[i], "trio2", DEV_CLASS_BACKBONE); assert(mesh[i]); + free(path); meshlink_add_address(mesh[i], "localhost"); @@ -87,6 +86,7 @@ int main() { // start the nodes for(int i = 0; i < 3; i++) { + free(data[i]); assert(meshlink_start(mesh[i])); } @@ -100,6 +100,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 nodes nodes