summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-08-22 05:54:46 (GMT)
committerGitHub <noreply@github.com>2018-08-22 05:54:46 (GMT)
commitb8e7319d39bf44355bf60f9bbec07cfbbe56739d (patch)
treef5353c41326f9f91b75f47cbfd417c4f6297334b /Python
parent3152bc36fd1a8ab349d6802e9b48dd88a35b3620 (diff)
downloadcpython-b8e7319d39bf44355bf60f9bbec07cfbbe56739d.zip
cpython-b8e7319d39bf44355bf60f9bbec07cfbbe56739d.tar.gz
cpython-b8e7319d39bf44355bf60f9bbec07cfbbe56739d.tar.bz2
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 <izbyshev@ispras.ru>
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 6e1793d..5001ad5 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;