summaryrefslogtreecommitdiff
path: root/Python/ast.c
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2006-03-07 15:39:21 +0000
committerHye-Shik Chang <hyeshik@gmail.com>2006-03-07 15:39:21 +0000
commitdfc47a8b931a2e519e292278fb641e7f6b2d47e7 (patch)
tree9c9de63bbe4621760fad9853fd171fb3d364d227 /Python/ast.c
parent3d14e6b4f53a9f54a49c44660e8121d0b84511ed (diff)
downloadcpython-dfc47a8b931a2e519e292278fb641e7f6b2d47e7.tar.gz
SF #1444030: Fix several potential defects found by Coverity.
(reviewed by Neal Norwitz)
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 5fbea395d8..bb1774bb97 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -1438,6 +1438,8 @@ ast_for_trailer(struct compiling *c, const node *n, expr_ty left_expr)
}
/* extract Index values and put them in a Tuple */
elts = asdl_seq_new(asdl_seq_LEN(slices), c->c_arena);
+ if (!elts)
+ return NULL;
for (j = 0; j < asdl_seq_LEN(slices); ++j) {
slc = (slice_ty)asdl_seq_GET(slices, j);
assert(slc->kind == Index_kind && slc->v.Index.value);