[Zope3-checkins] SVN: Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c Added error checking when initializing 'emptystr' static variable in

Ruslan Spivak rspivak at nuxeo.com
Fri Aug 5 16:40:55 EDT 2005


Log message for revision 37747:
  Added error checking when initializing 'emptystr' static variable in 
  module's init.

Changed:
  U   Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c

-=-
Modified: Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c
===================================================================
--- Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c	2005-08-05 20:39:09 UTC (rev 37746)
+++ Zope3/branches/alienoid-adapter_lookup_coptimizations/src/zope/interface/_zope_adapter_lookup_coptimizations.c	2005-08-05 20:40:54 UTC (rev 37747)
@@ -1108,7 +1108,8 @@
         DEFINE_STRING(index);
 #undef DEFINE_STRING
 
-        emptystr = PyString_FromString("");
+        if (!(emptystr = PyString_FromString("")))
+                return;
 
         /* Initialize types: */
         AdapterLookupType.tp_new = PyType_GenericNew;



More information about the Zope3-Checkins mailing list