X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fconf.c;h=5231a9dfca25fc16c1a8fd3fbf63b9c0a8001081;hb=6d1ac53f5c34ece4c7a82efb432a8e1d81fcff0d;hp=aa22c47ff9a67807e2721ba7d7671a3bcbfe7a0e;hpb=656a7bca4fd4acac5c3411087a6ed62fa4b7fa81;p=meshlink diff --git a/src/conf.c b/src/conf.c index aa22c47f..5231a9df 100644 --- a/src/conf.c +++ b/src/conf.c @@ -51,7 +51,8 @@ void init_configuration(splay_tree_t **config_tree) { } void exit_configuration(splay_tree_t **config_tree) { - splay_delete_tree(*config_tree); + if(*config_tree) + splay_delete_tree(*config_tree); *config_tree = NULL; } @@ -323,6 +324,7 @@ bool append_config_file(meshlink_handle_t *mesh, const char *name, const char *k if(!fp) { logger(DEBUG_ALWAYS, LOG_ERR, "Cannot open config file %s: %s", filename, strerror(errno)); } else { + fprintf(fp, "%s = %s\n", key, value); fclose(fp); }