Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28a2ad5

Browse files
author
Stefan Krah
committed
Check return value of asdl_seq_new(). Found by Coverity.
1 parent 8bd24fe commit 28a2ad5

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Python/ast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,6 +3502,8 @@ ast_for_with_stmt(struct compiling *c, const node *n)
35023502

35033503
n_items = (NCH(n) - 2) / 2;
35043504
items = asdl_seq_new(n_items, c->c_arena);
3505+
if (!items)
3506+
return NULL;
35053507
for (i = 1; i < NCH(n) - 2; i += 2) {
35063508
withitem_ty item = ast_for_with_item(c, CHILD(n, i));
35073509
if (!item)

0 commit comments

Comments
 (0)