diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-08-20 14:07:38 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-08-20 14:07:38 (GMT) |
commit | 28a2ad556a612af7bbc9bd2d23f00983025db3b6 (patch) | |
tree | b7c86fe3bc5a94ed57e768f1c3a904022a30288e /Python | |
parent | 8bd24fe9ff1c4d5dd3929465fc208b1375c32981 (diff) | |
download | cpython-28a2ad556a612af7bbc9bd2d23f00983025db3b6.zip cpython-28a2ad556a612af7bbc9bd2d23f00983025db3b6.tar.gz cpython-28a2ad556a612af7bbc9bd2d23f00983025db3b6.tar.bz2 |
Check return value of asdl_seq_new(). Found by Coverity.
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c index eb8aed2..fc6c565 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3502,6 +3502,8 @@ ast_for_with_stmt(struct compiling *c, const node *n) n_items = (NCH(n) - 2) / 2; items = asdl_seq_new(n_items, c->c_arena); + if (!items) + return NULL; for (i = 1; i < NCH(n) - 2; i += 2) { withitem_ty item = ast_for_with_item(c, CHILD(n, i)); if (!item) |