summaryrefslogtreecommitdiffstats
path: root/libbb
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-15 02:14:38 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-15 02:14:38 (EST)
commit3f4b79e8ce98192e59d6488e2e8f9fe178487571 (patch)
treef085e5cbe3f13d713ff6506ccf7ddd06cefd30b9 /libbb
parent12cd4c076b5974505097e41e22ef5dc8d78b85e1 (diff)
I'm still seeing leaks here. So just stop allocating for these variables.
git-svn-id: http://opkg.googlecode.com/svn/trunk@303 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libbb')
-rw-r--r--libbb/unarchive.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c
index c9eb4d0..bd10ad9 100644
--- a/libbb/unarchive.c
+++ b/libbb/unarchive.c
@@ -729,7 +729,7 @@ void free_header_tar(file_header_t *tar_entry)
char *deb_extract(const char *package_filename, FILE *out_stream,
const int extract_function, const char *prefix, const char *filename)
{
- FILE *deb_stream;
+ FILE *deb_stream = NULL;
FILE *uncompressed_stream = NULL;
file_header_t *ar_header = NULL;
char **file_list = NULL;
@@ -740,15 +740,15 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
if (filename != NULL) {
file_list = xmalloc(sizeof(char *) * 2);
- file_list[0] = xstrdup(filename);
+ file_list[0] = filename;
file_list[1] = NULL;
}
if (extract_function & extract_control_tar_gz) {
- ared_file = xstrdup("control.tar.gz");
+ ared_file = "control.tar.gz";
}
else if (extract_function & extract_data_tar_gz) {
- ared_file = xstrdup("data.tar.gz");
+ ared_file = "data.tar.gz";
} else {
fprintf(stderr, "no file specified to extract -- extract_function=%x\n", extract_function);
goto cleanup;
@@ -837,13 +837,10 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
}
cleanup:
- free(ared_file);
if (deb_stream)
fclose(deb_stream);
- if (file_list) {
- free(file_list[0]);
+ if (file_list)
free(file_list);
- }
return output_buffer;
}