diff Python/bltinmodule.c @ 78676:2b4f6770877e 2.7

Issue #15741: Fix potential NULL dereference. Found by Coverity.
author Stefan Krah <skrah@bytereef.org>
date Mon, 20 Aug 2012 17:31:22 +0200
parents ba1c48f8b571
children 3b484f53f91b
line wrap: on
line diff
--- a/Python/bltinmodule.c	Sun Aug 19 17:57:29 2012 -0400
+++ b/Python/bltinmodule.c	Mon Aug 20 17:31:22 2012 +0200
@@ -523,6 +523,8 @@
             mod_ty mod;
 
             arena = PyArena_New();
+            if (arena == NULL)
+                return NULL;
             mod = PyAST_obj2mod(cmd, arena, mode);
             if (mod == NULL) {
                 PyArena_Free(arena);