diff options
| author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-04-29 09:24:19 +0000 |
|---|---|---|
| committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2004-04-29 09:24:19 +0000 |
| commit | 65d8eb92b45d6567db4950174636f2cafc008e65 (patch) | |
| tree | bd91fdd6432939f0b39bfb585b3c07b7e49357c1 | |
| parent | 5ef1f0b668cfd53aeca829ecae8d4a57ed6c21f9 (diff) | |
| download | busybox-w32-65d8eb92b45d6567db4950174636f2cafc008e65.tar.gz busybox-w32-65d8eb92b45d6567db4950174636f2cafc008e65.tar.bz2 busybox-w32-65d8eb92b45d6567db4950174636f2cafc008e65.zip | |
Fix symlink handling and small memory leak
git-svn-id: svn://busybox.net/trunk/busybox@8785 69ca8d6d-28ef-0310-b511-8ec308f3f277
| -rw-r--r-- | archival/libunarchive/get_header_cpio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/archival/libunarchive/get_header_cpio.c b/archival/libunarchive/get_header_cpio.c index e8a68f1c3..f72c37634 100644 --- a/archival/libunarchive/get_header_cpio.c +++ b/archival/libunarchive/get_header_cpio.c | |||
| @@ -117,6 +117,8 @@ extern char get_header_cpio(archive_handle_t *archive_handle) | |||
| 117 | file_header->link_name[file_header->size] = '\0'; | 117 | file_header->link_name[file_header->size] = '\0'; |
| 118 | archive_handle->offset += file_header->size; | 118 | archive_handle->offset += file_header->size; |
| 119 | file_header->size = 0; /* Stop possible seeks in future */ | 119 | file_header->size = 0; /* Stop possible seeks in future */ |
| 120 | } else { | ||
| 121 | file_header->link_name = NULL; | ||
| 120 | } | 122 | } |
| 121 | if (nlink > 1 && !S_ISDIR(file_header->mode)) { | 123 | if (nlink > 1 && !S_ISDIR(file_header->mode)) { |
| 122 | if (file_header->size == 0) { /* Put file on a linked list for later */ | 124 | if (file_header->size == 0) { /* Put file on a linked list for later */ |
| @@ -151,5 +153,8 @@ extern char get_header_cpio(archive_handle_t *archive_handle) | |||
| 151 | } | 153 | } |
| 152 | 154 | ||
| 153 | archive_handle->offset += file_header->size; | 155 | archive_handle->offset += file_header->size; |
| 156 | |||
| 157 | free(file_header->link_name); | ||
| 158 | |||
| 154 | return (EXIT_SUCCESS); | 159 | return (EXIT_SUCCESS); |
| 155 | } | 160 | } |
