summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 15:24:53 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 15:24:53 -0800
commit3eebb3e044338fd989b05ab734658cf6208183b2 (patch)
treec0c5cbcc7d22e4e76368787bd29b02105e4f4193
parentMerge branch 'ma/list-object-filter-opt-msgfix' (diff)
parentarchive: release refname after use (diff)
downloadtgif-3eebb3e044338fd989b05ab734658cf6208183b2.tar.xz
Merge branch 'rs/archive-plug-leak-refname'
Memleak fix. * rs/archive-plug-leak-refname: archive: release refname after use
-rw-r--r--archive.c1
-rw-r--r--archive.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/archive.c b/archive.c
index 7a888c5338..5919d9e505 100644
--- a/archive.c
+++ b/archive.c
@@ -658,6 +658,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 e3d04e8ab3..33551b7ee1 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;