]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Plug memory leak in __archive_read_program()
authorMartin Matuska <martin@matuska.org>
Tue, 31 Jan 2017 02:51:49 +0000 (03:51 +0100)
committerMartin Matuska <martin@matuska.org>
Tue, 31 Jan 2017 02:53:19 +0000 (03:53 +0100)
libarchive/archive_read_support_filter_program.c

index 66dc2f424f8587a7ebe7286157306bf510e829dc..b8bf12886f34e140765f3c7fd6145dca096c11b6 100644 (file)
@@ -430,6 +430,7 @@ __archive_read_program(struct archive_read_filter *self, const char *cmd)
            &state->child_stdout);
        if (child == -1) {
                free(state->out_buf);
+               archive_string_free(&state->description);
                free(state);
                archive_set_error(&self->archive->archive, EINVAL,
                    "Can't initialize filter; unable to run program \"%s\"",
@@ -441,6 +442,7 @@ __archive_read_program(struct archive_read_filter *self, const char *cmd)
        if (state->child == NULL) {
                child_stop(self, state);
                free(state->out_buf);
+               archive_string_free(&state->description);
                free(state);
                archive_set_error(&self->archive->archive, EINVAL,
                    "Can't initialize filter; unable to run program \"%s\"",