Commit a15f7b85 authored by Philip Carns's avatar Philip Carns
Browse files

release json on exit

parent 3d6b0812
...@@ -228,6 +228,7 @@ int main(int argc, char **argv) ...@@ -228,6 +228,7 @@ int main(int argc, char **argv)
if(mid == MARGO_INSTANCE_NULL) if(mid == MARGO_INSTANCE_NULL)
{ {
fprintf(stderr, "Error: margo_init()\n"); fprintf(stderr, "Error: margo_init()\n");
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
free(cfg_str); free(cfg_str);
...@@ -250,6 +251,7 @@ int main(int argc, char **argv) ...@@ -250,6 +251,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Error: margo_addr_self()\n"); fprintf(stderr, "Error: margo_addr_self()\n");
margo_finalize(mid); margo_finalize(mid);
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
hret = margo_addr_to_string(mid, self_addr_str, &self_addr_str_sz, self_addr); hret = margo_addr_to_string(mid, self_addr_str, &self_addr_str_sz, self_addr);
...@@ -258,6 +260,7 @@ int main(int argc, char **argv) ...@@ -258,6 +260,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Error: margo_addr_to_string()\n"); fprintf(stderr, "Error: margo_addr_to_string()\n");
margo_addr_free(mid, self_addr); margo_addr_free(mid, self_addr);
margo_finalize(mid); margo_finalize(mid);
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
margo_addr_free(mid, self_addr); margo_addr_free(mid, self_addr);
...@@ -267,6 +270,7 @@ int main(int argc, char **argv) ...@@ -267,6 +270,7 @@ int main(int argc, char **argv)
{ {
perror("fopen"); perror("fopen");
margo_finalize(mid); margo_finalize(mid);
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
...@@ -285,6 +289,7 @@ int main(int argc, char **argv) ...@@ -285,6 +289,7 @@ int main(int argc, char **argv)
{ {
fprintf(stderr, "Error: hit provider limit of %d\n", MAX_PROVIDERS); fprintf(stderr, "Error: hit provider limit of %d\n", MAX_PROVIDERS);
margo_finalize(mid); margo_finalize(mid);
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
ret = bake_provider_register_json(mid, prov_index+1, ret = bake_provider_register_json(mid, prov_index+1,
...@@ -295,6 +300,7 @@ int main(int argc, char **argv) ...@@ -295,6 +300,7 @@ int main(int argc, char **argv)
{ {
bake_perror( "Error: bake_provider_register_json()", ret); bake_perror( "Error: bake_provider_register_json()", ret);
margo_finalize(mid); margo_finalize(mid);
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
free(prov_cfg_string); free(prov_cfg_string);
...@@ -308,6 +314,7 @@ int main(int argc, char **argv) ...@@ -308,6 +314,7 @@ int main(int argc, char **argv)
{ {
bake_perror("Error: bake_provider_add_storage_target()", ret); bake_perror("Error: bake_provider_add_storage_target()", ret);
margo_finalize(mid); margo_finalize(mid);
mochi_cfg_release_component(cfg);
return(-1); return(-1);
} }
...@@ -345,6 +352,7 @@ int main(int argc, char **argv) ...@@ -345,6 +352,7 @@ int main(int argc, char **argv)
/* suspend until the BAKE server gets a shutdown signal from the client */ /* suspend until the BAKE server gets a shutdown signal from the client */
margo_wait_for_finalize(mid); margo_wait_for_finalize(mid);
mochi_cfg_release_component(cfg);
free(opts.bake_pools); free(opts.bake_pools);
return(0); return(0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment