summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-10 19:46:56 (EST)
committer graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2009-11-10 19:46:56 (EST)
commitbf11afd779881043a7df4e511cffb4f7af121496 (patch)
tree23971a9bfd94e786a7324be38d3350a7c458d563
parentaad35f9e96c15956cf47c1be96faa23bdf745605 (diff)
More cleanup in error paths to plug leaks found while installing dbus.
git-svn-id: http://opkg.googlecode.com/svn/trunk@280 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
-rw-r--r--libbb/unarchive.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libbb/unarchive.c b/libbb/unarchive.c
index 53fa899..c9eb4d0 100644
--- a/libbb/unarchive.c
+++ b/libbb/unarchive.c
@@ -784,9 +784,7 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
free (ar_header);
}
gz_close(gunzip_pid);
- fclose(deb_stream);
fclose(uncompressed_stream);
- free(ared_file);
goto cleanup;
} else if (strncmp(ar_magic, "\037\213", 2) == 0) {
/* it's a gz file, let's assume it's an opkg */
@@ -832,8 +830,6 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
}
gz_close(unzipped_opkg_pid);
fclose(unzipped_opkg_stream);
- fclose(deb_stream);
- free(ared_file);
/*fprintf(stderr, __FUNCTION__ ":%d: done\n", __LINE__);*/
goto cleanup;
} else {
@@ -841,6 +837,9 @@ 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]);
free(file_list);