Daksh Mamodiya
c31361d089
file(ARCHIVE_EXTRACT): Fix resource leaks on error paths
...
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
2026-06-15 11:47:24 -04:00
..
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2026-04-22 13:46:49 -04:00
2026-04-22 13:46:49 -04:00
2025-12-03 02:45:30 -05:00
2026-04-22 13:46:49 -04:00
2025-12-03 02:45:30 -05:00
2024-10-03 11:52:22 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-04-22 13:59:20 -04:00
2022-06-29 17:43:41 -04:00
2025-10-16 17:42:12 +03:00
2022-06-29 17:43:41 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2026-03-24 14:07:21 -04:00
2022-06-29 17:43:41 -04:00
2025-10-16 17:42:12 +03:00
2022-06-29 17:43:41 -04:00
2026-06-15 11:47:24 -04:00
2026-06-15 11:47:24 -04:00
2026-06-15 11:47:24 -04:00
2026-04-14 15:57:13 -04:00
2025-12-11 12:00:31 -05:00
2025-12-17 14:38:30 -05:00
2026-04-14 15:48:36 -04:00
2025-12-17 14:38:30 -05:00
2026-01-16 08:54:07 -05:00
2026-01-16 08:54:07 -05:00
2026-01-16 08:54:07 -05:00
2026-01-16 08:54:07 -05:00
2026-01-16 08:54:07 -05:00
2026-01-16 08:54:07 -05:00
2025-12-02 10:44:49 +03:00
2025-12-02 10:44:49 +03:00
2022-11-16 09:15:01 -05:00
2025-11-10 15:11:10 -05:00
2026-04-23 09:06:36 -04:00
2026-06-15 11:47:24 -04:00
2025-12-03 02:45:30 -05:00
2025-12-03 02:45:30 -05:00
2025-12-03 02:45:30 -05:00
2025-12-03 02:45:30 -05:00
2026-04-22 13:59:20 -04:00
2026-04-22 13:46:49 -04:00
2025-12-17 14:38:30 -05:00
2026-04-14 15:48:36 -04:00
2026-03-24 14:07:21 -04:00
2024-09-11 09:52:32 -04:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2025-12-17 14:38:30 -05:00
2026-04-14 15:48:36 -04:00
2025-12-17 14:38:30 -05:00