components/libarchive/patches/archive_write_set_format_pax.c.patch
changeset 4997 714545171c17
parent 4995 ecffc6614cfa
child 5000 ba06ad809495
equal deleted inserted replaced
4995:ecffc6614cfa 4997:714545171c17
     1 A less complete version of this patch was fed back to the upstream community:
       
     2 http://code.google.com/p/libarchive/issues/detail?id=285
       
     3 This more complete patch was committed instead.  It should no longer be
       
     4 needed with the next release.
       
     5 
       
     6 --- libarchive/libarchive/archive_write_set_format_pax.c.orig	Mon Mar 26 19:49:00 2012
       
     7 +++ libarchive/libarchive/archive_write_set_format_pax.c	Sun Dec  2 04:03:38 2012
       
     8 @@ -647,8 +647,10 @@ archive_write_pax_header(struct archive_write *a,
       
     9 		oname = archive_entry_pathname(entry_original);
       
    10 		name_length = strlen(oname);
       
    11 		name = malloc(name_length + 3);
       
    12 -		if (name == NULL) {
       
    13 +		if (name == NULL || extra == NULL) {
       
    14 			/* XXX error message */
       
    15 +			archive_entry_free(extra);
       
    16 +			free(name);
       
    17 			return (ARCHIVE_FAILED);
       
    18 		}
       
    19 		strcpy(name, oname);
       
    20 @@ -687,6 +689,7 @@ archive_write_pax_header(struct archive_write *a,
       
    21 
       
    22 		/* Recurse to write the special copyfile entry. */
       
    23 		r = archive_write_pax_header(a, extra);
       
    24 +		archive_entry_free(extra);
       
    25 		if (r < ARCHIVE_WARN)
       
    26 			return (r);
       
    27 		if (r < ret)