X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fconf.c;fp=src%2Fconf.c;h=1a3c82ae2e8c45e5cf07cceaf2945bcc9eaac6bf;hb=e6d411107d7a7378c5ea34a1c79b77ed7f9428c4;hp=9664e2b776a923a9d33d69451d5867c52986b5b4;hpb=6bad600979ebea04def1ad53d3de0b06aac60b1e;p=meshlink diff --git a/src/conf.c b/src/conf.c index 9664e2b7..1a3c82ae 100644 --- a/src/conf.c +++ b/src/conf.c @@ -223,6 +223,7 @@ bool config_read_file(meshlink_handle_t *mesh, FILE *f, config_t *config) { chacha_poly1305_set_key(ctx, mesh->config_key); if(len > 12 && chacha_poly1305_decrypt_iv96(ctx, buf, buf + 12, len - 12, decrypted, &decrypted_len)) { + chacha_poly1305_exit(ctx); free(buf); config->buf = decrypted; config->len = decrypted_len; @@ -230,6 +231,7 @@ bool config_read_file(meshlink_handle_t *mesh, FILE *f, config_t *config) { } else { logger(mesh, MESHLINK_ERROR, "Cannot decrypt config file\n"); meshlink_errno = MESHLINK_ESTORAGE; + chacha_poly1305_exit(ctx); free(decrypted); free(buf); return false; @@ -330,7 +332,7 @@ void config_scan_all(meshlink_handle_t *mesh, config_scan_action_t action) { DIR *dir; struct dirent *ent; char dname[PATH_MAX]; - make_host_path(mesh, NULL, dname, sizeof(dname)); + make_host_path(mesh, "", dname, sizeof(dname)); dir = opendir(dname);