rouault commented on a change in pull request #44:
URL: https://github.com/apache/xerces-c/pull/44#discussion_r762457868



##########
File path: src/xercesc/validators/common/DFAContentModel.cpp
##########
@@ -1191,12 +1203,21 @@ void DFAContentModel::buildDFA(ContentSpecNode* const 
curNode)
                     //  table.
                     //
                     statesToDo[curState] = newSet;
-                    fTransTable[curState] = makeDefStateList();
-                    stateTable->put
-                    (
-                        newSet
-                        , new (fMemoryManager) XMLInteger(curState)
-                    );
+                    try
+                    {
+                        fTransTable[curState] = makeDefStateList();
+                        stateTable->put
+                        (
+                            newSet
+                            , new (fMemoryManager) XMLInteger(curState)
+                        );
+                    }
+                    catch( const OutOfMemoryException& e )
+                    {
+                        oomException = e;

Review comment:
       > 
   
   possibly. I didn't want to change the code too much. Your suggestion will 
probably involve moving the cleanup code in a lambda function that will be 
called at the end of the nominal code path and in the catch() block.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: c-dev-h...@xerces.apache.org

Reply via email to