Merge r282 from libarchive.googlecode.com: Close multiple filters

by walking the filter list in archive_read_close().
This commit is contained in:
Tim Kientzle 2009-03-03 03:33:25 +00:00
parent 80bb6bf259
commit bc14277c79
2 changed files with 3 additions and 3 deletions

View File

@ -595,11 +595,12 @@ archive_read_close(struct archive *_a)
/* TODO: Clean up the formatters. */ /* TODO: Clean up the formatters. */
/* Clean up the stream pipeline. */ /* Clean up the stream pipeline. */
if (a->source != NULL) { while (a->source != NULL) {
struct archive_read_source *t = a->source->upstream;
r1 = (a->source->close)(a->source); r1 = (a->source->close)(a->source);
if (r1 < r) if (r1 < r)
r = r1; r = r1;
a->source = NULL; a->source = t;
} }
/* Release the reader objects. */ /* Release the reader objects. */

View File

@ -339,7 +339,6 @@ compress_source_close(struct archive_read_source *self)
{ {
struct private_data *state = (struct private_data *)self->data; struct private_data *state = (struct private_data *)self->data;
self->upstream->close(self->upstream);
free(state->out_block); free(state->out_block);
free(state); free(state);
free(self); free(self);