bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)

Reported by Svace static analyzer.
This commit is contained in:
Alexey Izbyshev 2018-08-22 07:55:16 +03:00 committed by Serhiy Storchaka
parent f8c06b0280
commit 28853a249b

View File

@ -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;