]> granicus.if.org Git - python/commitdiff
Issue #15741: Fix potential NULL dereference. Found by Coverity.
authorStefan Krah <skrah@bytereef.org>
Mon, 20 Aug 2012 15:19:50 +0000 (17:19 +0200)
committerStefan Krah <skrah@bytereef.org>
Mon, 20 Aug 2012 15:19:50 +0000 (17:19 +0200)
Python/bltinmodule.c

index 0e904909d1d721cfb43ed5bc629832d6c96bd0a5..b85e37bc2954a525f188ecb9bc8040798a850c84 100644 (file)
@@ -631,6 +631,8 @@ builtin_compile(PyObject *self, PyObject *args, PyObject *kwds)
             mod_ty mod;
 
             arena = PyArena_New();
+            if (arena == NULL)
+                goto error;
             mod = PyAST_obj2mod(cmd, arena, mode);
             if (mod == NULL) {
                 PyArena_Free(arena);