diff options
Diffstat (limited to 'src/regex/regex_internal.c')
-rw-r--r-- | src/regex/regex_internal.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c index 4e0d5acc5..2eeb48b3b 100644 --- a/src/regex/regex_internal.c +++ b/src/regex/regex_internal.c | |||
@@ -132,7 +132,7 @@ state_add_transition (struct REGEX_INTERNAL_Context *ctx, | |||
132 | break; | 132 | break; |
133 | } | 133 | } |
134 | 134 | ||
135 | t = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Transition)); | 135 | t = GNUNET_new (struct REGEX_INTERNAL_Transition); |
136 | if (NULL != ctx) | 136 | if (NULL != ctx) |
137 | t->id = ctx->transition_id++; | 137 | t->id = ctx->transition_id++; |
138 | if (NULL != label) | 138 | if (NULL != label) |
@@ -1774,7 +1774,7 @@ dfa_state_create (struct REGEX_INTERNAL_Context *ctx, | |||
1774 | struct REGEX_INTERNAL_Transition *ctran; | 1774 | struct REGEX_INTERNAL_Transition *ctran; |
1775 | unsigned int i; | 1775 | unsigned int i; |
1776 | 1776 | ||
1777 | s = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_State)); | 1777 | s = GNUNET_new (struct REGEX_INTERNAL_State); |
1778 | s->id = ctx->state_id++; | 1778 | s->id = ctx->state_id++; |
1779 | s->index = -1; | 1779 | s->index = -1; |
1780 | s->lowlink = -1; | 1780 | s->lowlink = -1; |
@@ -2143,7 +2143,7 @@ dfa_add_multi_strides_helper (void *cls, const unsigned int depth, char *label, | |||
2143 | 2143 | ||
2144 | if (depth == ctx->stride) | 2144 | if (depth == ctx->stride) |
2145 | { | 2145 | { |
2146 | t = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Transition)); | 2146 | t = GNUNET_new (struct REGEX_INTERNAL_Transition); |
2147 | t->label = GNUNET_strdup (label); | 2147 | t->label = GNUNET_strdup (label); |
2148 | t->to_state = s; | 2148 | t->to_state = s; |
2149 | t->from_state = start; | 2149 | t->from_state = start; |
@@ -2258,7 +2258,7 @@ dfa_compress_paths_helper (struct REGEX_INTERNAL_Automaton *dfa, | |||
2258 | max_len == strlen (label)) || | 2258 | max_len == strlen (label)) || |
2259 | (start == dfa->start && GNUNET_REGEX_INITIAL_BYTES == strlen (label)))) | 2259 | (start == dfa->start && GNUNET_REGEX_INITIAL_BYTES == strlen (label)))) |
2260 | { | 2260 | { |
2261 | t = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Transition)); | 2261 | t = GNUNET_new (struct REGEX_INTERNAL_Transition); |
2262 | t->label = GNUNET_strdup (label); | 2262 | t->label = GNUNET_strdup (label); |
2263 | t->to_state = cur; | 2263 | t->to_state = cur; |
2264 | t->from_state = start; | 2264 | t->from_state = start; |
@@ -2375,7 +2375,7 @@ nfa_fragment_create (struct REGEX_INTERNAL_State *start, | |||
2375 | { | 2375 | { |
2376 | struct REGEX_INTERNAL_Automaton *n; | 2376 | struct REGEX_INTERNAL_Automaton *n; |
2377 | 2377 | ||
2378 | n = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Automaton)); | 2378 | n = GNUNET_new (struct REGEX_INTERNAL_Automaton); |
2379 | 2379 | ||
2380 | n->type = NFA; | 2380 | n->type = NFA; |
2381 | n->start = NULL; | 2381 | n->start = NULL; |
@@ -2448,7 +2448,7 @@ nfa_state_create (struct REGEX_INTERNAL_Context *ctx, int accepting) | |||
2448 | { | 2448 | { |
2449 | struct REGEX_INTERNAL_State *s; | 2449 | struct REGEX_INTERNAL_State *s; |
2450 | 2450 | ||
2451 | s = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_State)); | 2451 | s = GNUNET_new (struct REGEX_INTERNAL_State); |
2452 | s->id = ctx->state_id++; | 2452 | s->id = ctx->state_id++; |
2453 | s->accepting = accepting; | 2453 | s->accepting = accepting; |
2454 | s->marked = GNUNET_NO; | 2454 | s->marked = GNUNET_NO; |
@@ -3043,7 +3043,7 @@ REGEX_INTERNAL_construct_dfa (const char *regex, const size_t len, | |||
3043 | return NULL; | 3043 | return NULL; |
3044 | } | 3044 | } |
3045 | 3045 | ||
3046 | dfa = GNUNET_malloc (sizeof (struct REGEX_INTERNAL_Automaton)); | 3046 | dfa = GNUNET_new (struct REGEX_INTERNAL_Automaton); |
3047 | dfa->type = DFA; | 3047 | dfa->type = DFA; |
3048 | dfa->regex = GNUNET_strdup (regex); | 3048 | dfa->regex = GNUNET_strdup (regex); |
3049 | 3049 | ||