From 74aced1051fd7b49111cde220c7d12a449ab53e5 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Fri, 6 Mar 2009 04:22:34 +0000 Subject: [PATCH] Merge r398 from libarchive.googlecode.com: Check that bidder object was allocated before we try to use it. --- lib/libarchive/archive_read_support_compression_program.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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;