diff --git a/modfetch.c b/modfetch.c index d1134ea..60be82e 100644 --- a/modfetch.c +++ b/modfetch.c @@ -218,12 +218,14 @@ int main(int argc, char *argv[]) { fprintf(stderr, "error: failed formatting config dir (this shouldn't happen)"); exit(EXIT_FAILURE); } + free(home); } if (asprintf(&config_path, "%s/modfetch.conf", config_dir) < 0) { fprintf(stderr, "error: failed formatting config path (this shouldn't happen)"); exit(EXIT_FAILURE); } + free(config_dir); for (size_t i = 1; i < (size_t)argc; ++i) { if (strcmp(argv[i], "-c") == 0 || strcmp(argv[i], "--config") == 0) { @@ -257,6 +259,7 @@ int main(int argc, char *argv[]) { Config config = parse_config(config_file); fclose(config_file); + free(config_path); for (size_t i = 0; i < config.module_count; ++i) { Module current_module = config.modules[i];