]> granicus.if.org Git - python/commitdiff
Check return value of asdl_seq_new(). Found by Coverity.
authorStefan Krah <skrah@bytereef.org>
Mon, 20 Aug 2012 14:07:38 +0000 (16:07 +0200)
committerStefan Krah <skrah@bytereef.org>
Mon, 20 Aug 2012 14:07:38 +0000 (16:07 +0200)
Python/ast.c

index eb8aed2a2e9df8a2fa8121b82fb58aae21accd3d..fc6c565b21a6144f6151b3fe21240596f201accc 100644 (file)
@@ -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)