PERFORCE change 146092 for review
Anselm Strauss
strauss at FreeBSD.org
Mon Jul 28 07:13:10 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=146092
Change 146092 by strauss at strauss_marvelman on 2008/07/28 07:12:22
Cleaner code for archive freeing (Tim)
Affected files ...
.. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#20 edit
Differences ...
==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#20 (text+ko) ====
@@ -329,15 +329,14 @@
archive_write_zip_destroy(struct archive_write *a)
{
struct zip *zip;
- struct zip_file_header_link *l1, *l2;
+ struct zip_file_header_link *l;
zip = a->format_data;
- l1 = l2 = zip->central_directory;
- while (l2 != NULL) {
- l2 = l1->next;
- free(l1->entry);
- free(l1);
- l1 = l2;
+ while (zip->central_directory != NULL) {
+ l = zip->central_directory;
+ zip->central_directory = l->next;
+ archive_entry_free(l->entry);
+ free(l);
}
free(zip);
a->format_data = NULL;
More information about the p4-projects
mailing list