summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-08-20 16:07:38 +0200
committerStefan Krah <skrah@bytereef.org>2012-08-20 16:07:38 +0200
commit2aa97e0824bec321d345bcf716f623737a862cfa (patch)
tree0f0076b148a63360b9f0cdfb8601924c59db5622 /Python/ast.c
parentc4b06891d4807c739122b5cb812c82fd35f709f3 (diff)
downloadcpython-2aa97e0824bec321d345bcf716f623737a862cfa.tar.gz
Check return value of asdl_seq_new(). Found by Coverity.
Diffstat (limited to 'Python/ast.c')
-rw-r--r--Python/ast.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index eb8aed2a2e..fc6c565b21 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)