Issue #15741: Fix potential NULL dereference. Found by Coverity.
authorStefan Krah <skrah@bytereef.org>
Mon, 20 Aug 2012 15:31:22 +0000 (17:31 +0200)
committerStefan Krah <skrah@bytereef.org>
Mon, 20 Aug 2012 15:31:22 +0000 (17:31 +0200)
Python/bltinmodule.c

index a07b78c8d984819e8613b7f95ef2f03981674f35..b4f0e24aaf7bccbf3fc175483e01999928c622d5 100644 (file)
@@ -523,6 +523,8 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
             mod_ty mod;
 
             arena = PyArena_New();
+            if (arena == NULL)
+                return NULL;
             mod = PyAST_obj2mod(cmd, arena, mode);
             if (mod == NULL) {
                 PyArena_Free(arena);