Skip to content

Commit 97ae9ed

Browse files
Alexey Izbyshevmiss-islington
authored andcommitted
bpo-34457: Python/ast.c: Add missing NULL check to alias_for_import_name(). (pythonGH-8852)
Reported by Svace static analyzer. (cherry picked from commit 28853a2) Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
1 parent 985dcd4 commit 97ae9ed

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎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)