aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-07-11 07:22:17 +0000
committerbug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-07-11 07:22:17 +0000
commit110c682686ca5c358f7d42da49bf8d594b2232b7 (patch)
tree012577ccbe46f5ef825179d597e9747aa58869c4 /libbb
parent6c0b7fe7c96a8ac3bf11220f3e8d605e4ac399e2 (diff)
downloadbusybox-w32-110c682686ca5c358f7d42da49bf8d594b2232b7.tar.gz
busybox-w32-110c682686ca5c358f7d42da49bf8d594b2232b7.tar.bz2
busybox-w32-110c682686ca5c358f7d42da49bf8d594b2232b7.zip
minor dmalloc inspired cleanups
git-svn-id: svn://busybox.net/trunk/busybox@3061 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/unarchive.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c
index fe061ea12..a17f7af50 100644
--- a/libbb/unarchive.c
+++ b/libbb/unarchive.c
@@ -219,6 +219,9 @@ char *unarchive(FILE *src_stream, file_header_t *(*get_headers)(FILE *),
219 int i; 219 int i;
220 char *buffer = NULL; 220 char *buffer = NULL;
221 221
222 if (extract_names == NULL) {
223 return(NULL);
224 }
222 archive_offset = 0; 225 archive_offset = 0;
223 while ((file_entry = get_headers(src_stream)) != NULL) { 226 while ((file_entry = get_headers(src_stream)) != NULL) {
224 found = FALSE; 227 found = FALSE;
@@ -259,7 +262,6 @@ file_header_t *get_header_ar(FILE *src_stream)
259 static char *ar_long_names; 262 static char *ar_long_names;
260 263
261 if (fread(ar.raw, 1, 60, src_stream) != 60) { 264 if (fread(ar.raw, 1, 60, src_stream) != 60) {
262 free (ar_long_names);
263 return(NULL); 265 return(NULL);
264 } 266 }
265 archive_offset += 60; 267 archive_offset += 60;
@@ -535,10 +537,14 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
535 char **file_list; 537 char **file_list;
536 int gunzip_pid; 538 int gunzip_pid;
537 539
538 file_list = malloc(sizeof(char *)); 540 if (filename == NULL) {
539 file_list[0] = xstrdup(filename); 541 file_list = NULL;
540 file_list[1] = NULL; 542 } else {
541 543 file_list = xmalloc(sizeof(char *) * 3);
544 file_list[0] = xstrdup(filename);
545 file_list[1] = NULL;
546 }
547
542 if (extract_function & extract_control_tar_gz) { 548 if (extract_function & extract_control_tar_gz) {
543 ared_file = xstrdup("control.tar.gz"); 549 ared_file = xstrdup("control.tar.gz");
544 } 550 }