regex: do not ignore memory allocation failure
[pspp] / lib / regex_internal.c
index a116106708508c828fff134cb45049418a824f8a..378b767d8228ad7750d27f815a9a37dbd88dfb63 100644 (file)
@@ -1716,7 +1716,9 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                  free_state (newstate);
                  return NULL;
                }
-             re_node_set_init_copy (newstate->entrance_nodes, nodes);
+             if (re_node_set_init_copy (newstate->entrance_nodes, nodes)
+                 != REG_NOERROR)
+               return NULL;
              nctx_nodes = 0;
              newstate->has_constraint = 1;
            }