summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2018-08-22 04:55:16 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-08-22 04:55:16 (GMT)
commit28853a249b1d0c890b7e9ca345290bb8c1756446 (patch)
treedf17bc712ecfb2839ba9552566d4eb331ae32eac /Python
parentf8c06b028036e50596e75d4c9f6b27ba05133efe (diff)
downloadcpython-28853a249b1d0c890b7e9ca345290bb8c1756446.zip
cpython-28853a249b1d0c890b7e9ca345290bb8c1756446.tar.gz
cpython-28853a249b1d0c890b7e9ca345290bb8c1756446.tar.bz2
bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)
Reported by Svace static analyzer.
Diffstat (limited to 'Python')
-rw-r--r--Python/ast.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c
index 3b4cd16..a91c075 100644
--- a/Python/ast.c
+++ b/Python/ast.c
@@ -3252,6 +3252,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
break;
case STAR:
str = PyUnicode_InternFromString("*");
+ if (!str)
+ return NULL;
if (PyArena_AddPyObject(c->c_arena, str) < 0) {
Py_DECREF(str);
return NULL;