Skip to content

Commit 28853a2

Browse files
Alexey Izbyshevserhiy-storchaka
authored andcommitted
bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (GH-8852)
Reported by Svace static analyzer.
1 parent f8c06b0 commit 28853a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/ast.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,6 +3252,8 @@ alias_for_import_name(struct compiling *c, const node *n, int store)
32523252
break;
32533253
case STAR:
32543254
str = PyUnicode_InternFromString("*");
3255+
if (!str)
3256+
return NULL;
32553257
if (PyArena_AddPyObject(c->c_arena, str) < 0) {
32563258
Py_DECREF(str);
32573259
return NULL;

0 commit comments

Comments
 (0)