Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 2008 07:13:09 GMT
From:      Anselm Strauss <strauss@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 146092 for review
Message-ID:  <200807280713.m6S7D9bu056722@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=146092

Change 146092 by strauss@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807280713.m6S7D9bu056722>