mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-21 11:13:30 +00:00
Merge r389 from libarchive.googlecode.com: Fix a memory
leak in ISO9660 handler structure whenever a file entry has a nonsensical CE offset.
This commit is contained in:
parent
20e9dede5e
commit
90e7486664
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189419
@ -414,8 +414,10 @@ archive_read_format_iso9660_read_header(struct archive_read *a,
|
||||
|
||||
/* Get the next entry that appears after the current offset. */
|
||||
r = next_entry_seek(a, iso9660, &file);
|
||||
if (r != ARCHIVE_OK)
|
||||
if (r != ARCHIVE_OK) {
|
||||
release_file(iso9660, file);
|
||||
return (r);
|
||||
}
|
||||
|
||||
iso9660->entry_bytes_remaining = file->size;
|
||||
iso9660->entry_sparse_offset = 0; /* Offset for sparse-file-aware clients. */
|
||||
@ -1093,6 +1095,9 @@ release_file(struct iso9660 *iso9660, struct file_info *file)
|
||||
{
|
||||
struct file_info *parent;
|
||||
|
||||
if (file == NULL)
|
||||
return;
|
||||
|
||||
if (file->refcount == 0) {
|
||||
parent = file->parent;
|
||||
archive_string_free(&file->name);
|
||||
|
Loading…
Reference in New Issue
Block a user