diff --git a/archive.c b/archive.c index 3c1541af9e2dfb..da89d292c291f4 100644 --- a/archive.c +++ b/archive.c @@ -662,6 +662,7 @@ int write_archive(int argc, const char **argv, const char *prefix, rc = ar->write_archive(ar, &args); string_list_clear_func(&args.extra_files, extra_file_info_clear); + free(args.refname); return rc; } diff --git a/archive.h b/archive.h index 82b226011abb60..43028ffbf37fa1 100644 --- a/archive.h +++ b/archive.h @@ -8,7 +8,7 @@ struct repository; struct archiver_args { struct repository *repo; - const char *refname; + char *refname; const char *prefix; const char *base; size_t baselen;