mirror of
https://github.com/sheumann/hush.git
synced 2025-03-01 12:30:09 +00:00
minor dmalloc inspired cleanups
This commit is contained in:
parent
59e50f634a
commit
248c57ca43
@ -219,6 +219,9 @@ char *unarchive(FILE *src_stream, file_header_t *(*get_headers)(FILE *),
|
|||||||
int i;
|
int i;
|
||||||
char *buffer = NULL;
|
char *buffer = NULL;
|
||||||
|
|
||||||
|
if (extract_names == NULL) {
|
||||||
|
return(NULL);
|
||||||
|
}
|
||||||
archive_offset = 0;
|
archive_offset = 0;
|
||||||
while ((file_entry = get_headers(src_stream)) != NULL) {
|
while ((file_entry = get_headers(src_stream)) != NULL) {
|
||||||
found = FALSE;
|
found = FALSE;
|
||||||
@ -259,7 +262,6 @@ file_header_t *get_header_ar(FILE *src_stream)
|
|||||||
static char *ar_long_names;
|
static char *ar_long_names;
|
||||||
|
|
||||||
if (fread(ar.raw, 1, 60, src_stream) != 60) {
|
if (fread(ar.raw, 1, 60, src_stream) != 60) {
|
||||||
free (ar_long_names);
|
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
archive_offset += 60;
|
archive_offset += 60;
|
||||||
@ -535,10 +537,14 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
|
|||||||
char **file_list;
|
char **file_list;
|
||||||
int gunzip_pid;
|
int gunzip_pid;
|
||||||
|
|
||||||
file_list = malloc(sizeof(char *));
|
if (filename == NULL) {
|
||||||
file_list[0] = xstrdup(filename);
|
file_list = NULL;
|
||||||
file_list[1] = NULL;
|
} else {
|
||||||
|
file_list = xmalloc(sizeof(char *) * 3);
|
||||||
|
file_list[0] = xstrdup(filename);
|
||||||
|
file_list[1] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (extract_function & extract_control_tar_gz) {
|
if (extract_function & extract_control_tar_gz) {
|
||||||
ared_file = xstrdup("control.tar.gz");
|
ared_file = xstrdup("control.tar.gz");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user