Merge r398 from libarchive.googlecode.com: Check that bidder

object was allocated before we try to use it.
This commit is contained in:
Tim Kientzle 2009-03-06 04:22:34 +00:00
parent c6b235629a
commit 74aced1051
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=189428

View File

@ -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 archive_read_filter_bidder *bidder = __archive_read_get_bidder(a);
struct program_bidder *state; struct program_bidder *state;
state = (struct program_bidder *)calloc(sizeof (*state), 1);
if (state == NULL)
return (ARCHIVE_FATAL);
if (bidder == NULL) if (bidder == NULL)
return (ARCHIVE_FATAL); return (ARCHIVE_FATAL);
state = (struct program_bidder *)calloc(sizeof (*state), 1);
if (state == NULL)
return (ARCHIVE_FATAL);
state->cmd = strdup(cmd); state->cmd = strdup(cmd);
state->bid = INT_MAX; state->bid = INT_MAX;