[BusyBox-cvs] busybox/archival/libunarchive get_header_cpio.c, 1.9, 1.10

Glenn McGrath bug1 at busybox.net
Thu Apr 29 09:24:21 UTC 2004


Update of /var/cvs/busybox/archival/libunarchive
In directory nail:/tmp/cvs-serv21136/archival/libunarchive

Modified Files:
	get_header_cpio.c 
Log Message:
Fix symlink handling and small memory leak


Index: get_header_cpio.c
===================================================================
RCS file: /var/cvs/busybox/archival/libunarchive/get_header_cpio.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- a/get_header_cpio.c	15 Mar 2004 08:28:17 -0000	1.9
+++ b/get_header_cpio.c	29 Apr 2004 09:24:19 -0000	1.10
@@ -117,6 +117,8 @@
 		file_header->link_name[file_header->size] = '\0';
 		archive_handle->offset += file_header->size;
 		file_header->size = 0; /* Stop possible seeks in future */
+	} else {
+		file_header->link_name = NULL;
 	}
 	if (nlink > 1 && !S_ISDIR(file_header->mode)) {
 		if (file_header->size == 0) { /* Put file on a linked list for later */
@@ -151,5 +153,8 @@
 	}
 
 	archive_handle->offset += file_header->size;
+
+	free(file_header->link_name);
+
 	return (EXIT_SUCCESS);
 }




More information about the busybox-cvs mailing list