summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-09-18 21:04:21 (GMT)
committerBrad King <brad.king@kitware.com>2024-09-19 14:01:04 (GMT)
commit387a9a746a7f27c4b4ce8e4e58345382d088c511 (patch)
tree75f3341f7ca6db2f6878e31f87b1880b920fe5ee /Utilities
parentdad12c8010b039eff8db3445f63a27c716dd7b50 (diff)
downloadCMake-387a9a746a7f27c4b4ce8e4e58345382d088c511.zip
CMake-387a9a746a7f27c4b4ce8e4e58345382d088c511.tar.gz
CMake-387a9a746a7f27c4b4ce8e4e58345382d088c511.tar.bz2
libarchive: tar: fix memory leaks when reading symlinks or parsing pax headers
Backport [libarchive PR 2338] to fix [libarchive issue 2336]. [libarchive PR 2338]: https://github.com/libarchive/libarchive/pull/2338 [libarchive issue 2336]: https://github.com/libarchive/libarchive/issues/2336
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
index af601ef..cb103c3 100644
--- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
+++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_tar.c
@@ -296,6 +296,7 @@ archive_read_format_tar_cleanup(struct archive_read *a)
archive_string_free(&tar->entry_pathname_override);
archive_string_free(&tar->entry_uname);
archive_string_free(&tar->entry_gname);
+ archive_string_free(&tar->entry_linkpath);
archive_string_free(&tar->line);
archive_string_free(&tar->pax_global);
archive_string_free(&tar->longname);
@@ -1935,6 +1936,7 @@ header_pax_extension(struct archive_read *a, struct tar *tar,
*unconsumed += 1;
tar_flush_unconsumed(a, unconsumed);
}
+ archive_string_free(&attr_name);
*unconsumed += ext_size + ext_padding;
/*