From 3b11234ec7eb3c6c881aa6365a85695d0ece7b49 Mon Sep 17 00:00:00 2001 From: Alexey Izbyshev Date: Wed, 22 Aug 2018 07:55:16 +0300 Subject: [PATCH] [2.7] bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852) Reported by Svace static analyzer.. (cherry picked from commit 28853a249b1d0c890b7e9ca345290bb8c1756446) Co-authored-by: Alexey Izbyshev --- Python/ast.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/ast.c b/Python/ast.c index 318c0bb27d35c3..946032589f4b00 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -2520,6 +2520,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store) break; case STAR: str = PyString_InternFromString("*"); + if (!str) + return NULL; PyArena_AddPyObject(c->c_arena, str); return alias(str, NULL, c->c_arena); default: