Don't leak the ar_header or the tar_header.
authorgraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 23 Nov 2009 00:28:25 +0000 (00:28 +0000)
committergraham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
Mon, 23 Nov 2009 00:28:25 +0000 (00:28 +0000)
git-svn-id: http://opkg.googlecode.com/svn/trunk@347 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358

libbb/unarchive.c

index 5e9c13a547927c5d33c1764c027a1ec6517c436a..07c24f2fff44d3050b96d1e2fcef05cd47cc51bc 100644 (file)
@@ -662,6 +662,8 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
                                output_buffer = unarchive(uncompressed_stream, out_stream, get_header_tar, free_header_tar, extract_function, prefix, file_list);
                                fclose(uncompressed_stream);
                                gz_close(gunzip_pid);
+                               free (ar_header->name);
+                               free (ar_header);
                                break;
                        }
                        seek_sub_file(deb_stream, ar_header->size);
@@ -708,6 +710,7 @@ char *deb_extract(const char *package_filename, FILE *out_stream,
                                free_header_tar(tar_header);
                                fclose(uncompressed_stream);
                                gz_close(gunzip_pid);
+                               free_header_tar(tar_header);
                                break;
                        }
                        seek_sub_file(unzipped_opkg_stream, tar_header->size);