summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4d637ae..5905c45 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2384,7 +2384,10 @@ compiler_import_as(struct compiler *c, identifier name, identifier asname)
dot = strchr(src, '.');
attr = PyString_FromStringAndSize(src,
dot ? dot - src : strlen(src));
+ if (!attr)
+ return -1;
ADDOP_O(c, LOAD_ATTR, attr, names);
+ Py_DECREF(attr);
src = dot + 1;
}
}