diff options
author | kientzle <kientzle@FreeBSD.org> | 2009-03-06 04:22:34 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2009-03-06 04:22:34 +0000 |
commit | fd6ac6664361e245c8710149513f9af43754e513 (patch) | |
tree | 424084cf1feffeebe7627fbc75cfd48a1a61ec26 | |
parent | fad4d483cfef351a6dc745c3562e7b67b864556f (diff) | |
download | FreeBSD-src-fd6ac6664361e245c8710149513f9af43754e513.zip FreeBSD-src-fd6ac6664361e245c8710149513f9af43754e513.tar.gz |
Merge r398 from libarchive.googlecode.com: Check that bidder
object was allocated before we try to use it.
-rw-r--r-- | lib/libarchive/archive_read_support_compression_program.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libarchive/archive_read_support_compression_program.c b/lib/libarchive/archive_read_support_compression_program.c index d5cac14..05dbc32 100644 --- a/lib/libarchive/archive_read_support_compression_program.c +++ b/lib/libarchive/archive_read_support_compression_program.c @@ -109,12 +109,12 @@ 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 (bidder == NULL) + return (ARCHIVE_FATAL); + state = (struct program_bidder *)calloc(sizeof (*state), 1); if (state == NULL) return (ARCHIVE_FATAL); - if (bidder == NULL) - return (ARCHIVE_FATAL); state->cmd = strdup(cmd); state->bid = INT_MAX; |