Commit 28853a24 authored by Alexey Izbyshev's avatar Alexey Izbyshev Committed by Serhiy Storchaka

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

Reported by Svace static analyzer.
parent f8c06b02
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment