mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
extract_tar() allocates archive_read, archive_write_disk, and archive_match handles, but several early-return error paths did not free them. Most notably, a PATTERNS entry matching nothing leaked all three handles on every call, which accumulates inside a long-running configure. Scope the three handles with std::unique_ptr custom deleters so every return path releases them automatically. std::unique_ptr does not invoke the deleter for a null pointer, and the libarchive *_free functions are themselves no-ops on null, so no explicit guarding is required. archive_read_free()/archive_write_free() implicitly close the handle if needed, matching the previous behavior. Fixes: #27872
2 lines
55 B
Plaintext
2 lines
55 B
Plaintext
^CMake Error: tar: no_such_entry: Not found in archive
|