diff options
| -rw-r--r-- | libbb/unarchive.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c index 2d171b4ce..4d47eff0e 100644 --- a/libbb/unarchive.c +++ b/libbb/unarchive.c | |||
| @@ -129,7 +129,7 @@ char *extract_archive(FILE *src_stream, FILE *out_stream, const file_header_t *f | |||
| 129 | if (function & extract_create_leading_dirs) { /* Create leading directories with default umask */ | 129 | if (function & extract_create_leading_dirs) { /* Create leading directories with default umask */ |
| 130 | char *buf, *parent; | 130 | char *buf, *parent; |
| 131 | buf = xstrdup(full_name); | 131 | buf = xstrdup(full_name); |
| 132 | parent = dirname(full_name); | 132 | parent = dirname(buf); |
| 133 | if (make_directory (parent, -1, FILEUTILS_RECUR) != 0) { | 133 | if (make_directory (parent, -1, FILEUTILS_RECUR) != 0) { |
| 134 | if ((function & extract_quiet) != extract_quiet) { | 134 | if ((function & extract_quiet) != extract_quiet) { |
| 135 | error_msg("couldn't create leading directories"); | 135 | error_msg("couldn't create leading directories"); |
| @@ -160,7 +160,7 @@ char *extract_archive(FILE *src_stream, FILE *out_stream, const file_header_t *f | |||
| 160 | if (stat_res != 0) { | 160 | if (stat_res != 0) { |
| 161 | if (mkdir(full_name, file_entry->mode) < 0) { | 161 | if (mkdir(full_name, file_entry->mode) < 0) { |
| 162 | if ((function & extract_quiet) != extract_quiet) { | 162 | if ((function & extract_quiet) != extract_quiet) { |
| 163 | perror_msg("extract_archive: "); | 163 | perror_msg("extract_archive: %s", full_name); |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | } | 166 | } |
| @@ -266,6 +266,9 @@ char *unarchive(FILE *src_stream, FILE *out_stream, file_header_t *(*get_headers | |||
| 266 | /* seek past the data entry */ | 266 | /* seek past the data entry */ |
| 267 | seek_sub_file(src_stream, file_entry->size); | 267 | seek_sub_file(src_stream, file_entry->size); |
| 268 | } | 268 | } |
| 269 | free(file_entry->name); /* may be null, but doesn't matter */ | ||
| 270 | free(file_entry->link_name); | ||
| 271 | free(file_entry); | ||
| 269 | } | 272 | } |
| 270 | return(buffer); | 273 | return(buffer); |
| 271 | } | 274 | } |
