Release attr_name memory on error paths.
Fixes: 101646e34e88 ("tar: Keep block alignment after pax error")
Fixes: 36a530973a91 ("Fix an infinite loop when parsing `V` headers")
/* Consume size, name, and `=` */
*unconsumed += p - attr_start;
if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
+ archive_string_free(&attr_name);
return (ARCHIVE_FATAL);
}
archive_set_error(&a->archive, EINVAL,
"Malformed pax attributes");
*unconsumed += ext_size + ext_padding;
+ archive_string_free(&attr_name);
return (ARCHIVE_WARN);
}