Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix memory leaks in pax writer when handing mac metadata.

  • Loading branch information...
commit 1c7d5f303513af975bbc4343de4f774d3bcd3aee 1 parent 3bfbc99
@ggcueroad ggcueroad authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 libarchive/archive_write_set_format_pax.c
View
5 libarchive/archive_write_set_format_pax.c
@@ -647,8 +647,10 @@ archive_write_pax_header(struct archive_write *a,
oname = archive_entry_pathname(entry_original);
name_length = strlen(oname);
name = malloc(name_length + 3);
- if (name == NULL) {
+ if (name == NULL || extra == NULL) {
/* XXX error message */
+ archive_entry_free(extra);
+ free(name);
return (ARCHIVE_FAILED);
}
strcpy(name, oname);
@@ -687,6 +689,7 @@ archive_write_pax_header(struct archive_write *a,
/* Recurse to write the special copyfile entry. */
r = archive_write_pax_header(a, extra);
+ archive_entry_free(extra);
if (r < ARCHIVE_WARN)
return (r);
if (r < ret)
Please sign in to comment.
Something went wrong with that request. Please try again.