diff --git a/lib/libarchive/archive_read_support_compression_program.c b/lib/libarchive/archive_read_support_compression_program.c index d5cac14b36dd..05dbc32eb1a4 100644 --- a/lib/libarchive/archive_read_support_compression_program.c +++ b/lib/libarchive/archive_read_support_compression_program.c @@ -109,13 +109,13 @@ archive_read_support_compression_program(struct archive *_a, const char *cmd) struct archive_read_filter_bidder *bidder = __archive_read_get_bidder(a); struct program_bidder *state; - state = (struct program_bidder *)calloc(sizeof (*state), 1); - - if (state == NULL) - return (ARCHIVE_FATAL); if (bidder == NULL) return (ARCHIVE_FATAL); + state = (struct program_bidder *)calloc(sizeof (*state), 1); + if (state == NULL) + return (ARCHIVE_FATAL); + state->cmd = strdup(cmd); state->bid = INT_MAX;