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 28853a249b)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
This commit is contained in:
Miss Islington (bot) 2018-08-22 01:54:46 -04:00 committed by GitHub
parent 3152bc36fd
commit b8e7319d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

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;