From: Stefan Krah Date: Mon, 20 Aug 2012 14:07:38 +0000 (+0200) Subject: Check return value of asdl_seq_new(). Found by Coverity. X-Git-Tag: v3.3.0rc1~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28a2ad556a612af7bbc9bd2d23f00983025db3b6;p=thirdparty%2FPython%2Fcpython.git Check return value of asdl_seq_new(). Found by Coverity. --- diff --git a/Python/ast.c b/Python/ast.c index eb8aed2a2e9d..fc6c565b21a6 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)