diff Python/ast.c @ 78673:663de4dbb88a

Check return value of asdl_seq_new(). Found by Coverity.
author Stefan Krah <skrah@bytereef.org>
date Mon, 20 Aug 2012 16:07:38 +0200
parents 6d992dea9391
children d61424122af5
line wrap: on
line diff
--- a/Python/ast.c	Mon Aug 20 23:02:28 2012 +1000
+++ b/Python/ast.c	Mon Aug 20 16:07:38 2012 +0200
@@ -3502,6 +3502,8 @@
 
     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)