diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-05 16:32:34 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-05 16:32:34 +0200 |
commit | e31c1d4a9f78c4e31fda1f98fe349b33abdd01a2 (patch) | |
tree | 61df772a93f7f21af7c715ddd4b9a3f1a50e0509 /src/regex | |
parent | 1437556645417e6302862845e7ebcbd4c9908357 (diff) | |
download | gnunet-e31c1d4a9f78c4e31fda1f98fe349b33abdd01a2.tar.gz gnunet-e31c1d4a9f78c4e31fda1f98fe349b33abdd01a2.zip |
GNUNET_free_non_null -> GNUNET_free
Diffstat (limited to 'src/regex')
-rw-r--r-- | src/regex/gnunet-regex-profiler.c | 4 | ||||
-rw-r--r-- | src/regex/gnunet-regex-simulation-profiler.c | 2 | ||||
-rw-r--r-- | src/regex/regex_internal.c | 26 | ||||
-rw-r--r-- | src/regex/regex_test_lib.c | 8 | ||||
-rw-r--r-- | src/regex/test_regex_eval_api.c | 8 |
5 files changed, 24 insertions, 24 deletions
diff --git a/src/regex/gnunet-regex-profiler.c b/src/regex/gnunet-regex-profiler.c index 3f8133d61..e82e10e3b 100644 --- a/src/regex/gnunet-regex-profiler.c +++ b/src/regex/gnunet-regex-profiler.c | |||
@@ -448,9 +448,9 @@ do_shutdown (void *cls) | |||
448 | search_str_cnt < num_peers && NULL != search_strings; | 448 | search_str_cnt < num_peers && NULL != search_strings; |
449 | search_str_cnt++) | 449 | search_str_cnt++) |
450 | { | 450 | { |
451 | GNUNET_free_non_null (search_strings[search_str_cnt]); | 451 | GNUNET_free (search_strings[search_str_cnt]); |
452 | } | 452 | } |
453 | GNUNET_free_non_null (search_strings); | 453 | GNUNET_free (search_strings); |
454 | search_strings = NULL; | 454 | search_strings = NULL; |
455 | 455 | ||
456 | if (NULL != reg_handle) | 456 | if (NULL != reg_handle) |
diff --git a/src/regex/gnunet-regex-simulation-profiler.c b/src/regex/gnunet-regex-simulation-profiler.c index 9adde99bd..3d449a04e 100644 --- a/src/regex/gnunet-regex-simulation-profiler.c +++ b/src/regex/gnunet-regex-simulation-profiler.c | |||
@@ -255,7 +255,7 @@ reset_meter (struct ProgressMeter *meter) | |||
255 | static void | 255 | static void |
256 | free_meter (struct ProgressMeter *meter) | 256 | free_meter (struct ProgressMeter *meter) |
257 | { | 257 | { |
258 | GNUNET_free_non_null (meter->startup_string); | 258 | GNUNET_free (meter->startup_string); |
259 | GNUNET_free (meter); | 259 | GNUNET_free (meter); |
260 | } | 260 | } |
261 | 261 | ||
diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c index 1dd4f6a97..cd33281e2 100644 --- a/src/regex/regex_internal.c +++ b/src/regex/regex_internal.c | |||
@@ -168,7 +168,7 @@ state_remove_transition (struct REGEX_INTERNAL_State *state, | |||
168 | if (transition->from_state != state) | 168 | if (transition->from_state != state) |
169 | return; | 169 | return; |
170 | 170 | ||
171 | GNUNET_free_non_null (transition->label); | 171 | GNUNET_free (transition->label); |
172 | 172 | ||
173 | state->transition_count--; | 173 | state->transition_count--; |
174 | GNUNET_CONTAINER_DLL_remove (state->transitions_head, | 174 | GNUNET_CONTAINER_DLL_remove (state->transitions_head, |
@@ -310,8 +310,8 @@ automaton_destroy_state (struct REGEX_INTERNAL_State *s) | |||
310 | if (NULL == s) | 310 | if (NULL == s) |
311 | return; | 311 | return; |
312 | 312 | ||
313 | GNUNET_free_non_null (s->name); | 313 | GNUNET_free (s->name); |
314 | GNUNET_free_non_null (s->proof); | 314 | GNUNET_free (s->proof); |
315 | state_set_clear (&s->nfa_set); | 315 | state_set_clear (&s->nfa_set); |
316 | for (t = s->transitions_head; NULL != t; t = next_t) | 316 | for (t = s->transitions_head; NULL != t; t = next_t) |
317 | { | 317 | { |
@@ -658,7 +658,7 @@ sb_realloc (struct StringBuffer *ret, size_t nlen) | |||
658 | ret->blen = nlen; | 658 | ret->blen = nlen; |
659 | GNUNET_memcpy (ret->abuf, ret->sbuf, ret->slen); | 659 | GNUNET_memcpy (ret->abuf, ret->sbuf, ret->slen); |
660 | ret->sbuf = ret->abuf; | 660 | ret->sbuf = ret->abuf; |
661 | GNUNET_free_non_null (old); | 661 | GNUNET_free (old); |
662 | } | 662 | } |
663 | 663 | ||
664 | 664 | ||
@@ -726,7 +726,7 @@ sb_wrap (struct StringBuffer *ret, const char *format, size_t extra_chars) | |||
726 | format, | 726 | format, |
727 | (int) ret->slen, | 727 | (int) ret->slen, |
728 | ret->sbuf); | 728 | ret->sbuf); |
729 | GNUNET_free_non_null (ret->abuf); | 729 | GNUNET_free (ret->abuf); |
730 | ret->abuf = temp; | 730 | ret->abuf = temp; |
731 | ret->sbuf = temp; | 731 | ret->sbuf = temp; |
732 | ret->blen = ret->slen + extra_chars + 1; | 732 | ret->blen = ret->slen + extra_chars + 1; |
@@ -1592,8 +1592,8 @@ automaton_create_proofs (struct REGEX_INTERNAL_Automaton *a) | |||
1592 | if ((NULL == R_last) || (NULL == R_cur)) | 1592 | if ((NULL == R_last) || (NULL == R_cur)) |
1593 | { | 1593 | { |
1594 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "malloc"); | 1594 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "malloc"); |
1595 | GNUNET_free_non_null (R_cur); | 1595 | GNUNET_free (R_cur); |
1596 | GNUNET_free_non_null (R_last); | 1596 | GNUNET_free (R_last); |
1597 | return GNUNET_SYSERR; | 1597 | return GNUNET_SYSERR; |
1598 | } | 1598 | } |
1599 | 1599 | ||
@@ -2159,7 +2159,7 @@ dfa_add_multi_strides_helper (void *cls, | |||
2159 | t->to_state); | 2159 | t->to_state); |
2160 | } | 2160 | } |
2161 | } | 2161 | } |
2162 | GNUNET_free_non_null (label); | 2162 | GNUNET_free (label); |
2163 | } | 2163 | } |
2164 | 2164 | ||
2165 | 2165 | ||
@@ -2213,7 +2213,7 @@ REGEX_INTERNAL_dfa_add_multi_strides (struct REGEX_INTERNAL_Context *regex_ctx, | |||
2213 | t_next = t->next; | 2213 | t_next = t->next; |
2214 | state_add_transition (regex_ctx, t->from_state, t->label, t->to_state); | 2214 | state_add_transition (regex_ctx, t->from_state, t->label, t->to_state); |
2215 | GNUNET_CONTAINER_DLL_remove (ctx.transitions_head, ctx.transitions_tail, t); | 2215 | GNUNET_CONTAINER_DLL_remove (ctx.transitions_head, ctx.transitions_tail, t); |
2216 | GNUNET_free_non_null (t->label); | 2216 | GNUNET_free (t->label); |
2217 | GNUNET_free (t); | 2217 | GNUNET_free (t); |
2218 | } | 2218 | } |
2219 | 2219 | ||
@@ -2361,7 +2361,7 @@ dfa_compress_paths (struct REGEX_INTERNAL_Context *regex_ctx, | |||
2361 | t_next = t->next; | 2361 | t_next = t->next; |
2362 | state_add_transition (regex_ctx, t->from_state, t->label, t->to_state); | 2362 | state_add_transition (regex_ctx, t->from_state, t->label, t->to_state); |
2363 | GNUNET_CONTAINER_DLL_remove (transitions_head, transitions_tail, t); | 2363 | GNUNET_CONTAINER_DLL_remove (transitions_head, transitions_tail, t); |
2364 | GNUNET_free_non_null (t->label); | 2364 | GNUNET_free (t->label); |
2365 | GNUNET_free (t); | 2365 | GNUNET_free (t); |
2366 | } | 2366 | } |
2367 | 2367 | ||
@@ -2972,7 +2972,7 @@ error: | |||
2972 | if (NULL != error_msg) | 2972 | if (NULL != error_msg) |
2973 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", error_msg); | 2973 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "%s\n", error_msg); |
2974 | 2974 | ||
2975 | GNUNET_free_non_null (p); | 2975 | GNUNET_free (p); |
2976 | 2976 | ||
2977 | while (NULL != (nfa = ctx.stack_head)) | 2977 | while (NULL != (nfa = ctx.stack_head)) |
2978 | { | 2978 | { |
@@ -3133,8 +3133,8 @@ REGEX_INTERNAL_automaton_destroy (struct REGEX_INTERNAL_Automaton *a) | |||
3133 | if (NULL == a) | 3133 | if (NULL == a) |
3134 | return; | 3134 | return; |
3135 | 3135 | ||
3136 | GNUNET_free_non_null (a->regex); | 3136 | GNUNET_free (a->regex); |
3137 | GNUNET_free_non_null (a->canonical_regex); | 3137 | GNUNET_free (a->canonical_regex); |
3138 | 3138 | ||
3139 | for (s = a->states_head; NULL != s; s = next_state) | 3139 | for (s = a->states_head; NULL != s; s = next_state) |
3140 | { | 3140 | { |
diff --git a/src/regex/regex_test_lib.c b/src/regex/regex_test_lib.c index 05001b5d2..58cd8dc10 100644 --- a/src/regex/regex_test_lib.c +++ b/src/regex/regex_test_lib.c | |||
@@ -222,10 +222,10 @@ regex_combine (struct RegexCombineCtx *ctx) | |||
222 | else | 222 | else |
223 | { | 223 | { |
224 | GNUNET_asprintf (&tmp, "%s%s|", regex, s); | 224 | GNUNET_asprintf (&tmp, "%s%s|", regex, s); |
225 | GNUNET_free_non_null (regex); | 225 | GNUNET_free (regex); |
226 | regex = tmp; | 226 | regex = tmp; |
227 | } | 227 | } |
228 | GNUNET_free_non_null (s); | 228 | GNUNET_free (s); |
229 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " so far '%s' for inner %s\n", regex, | 229 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " so far '%s' for inner %s\n", regex, |
230 | ctx->s); | 230 | ctx->s); |
231 | } | 231 | } |
@@ -517,7 +517,7 @@ regex_ctx_destroy (struct RegexCombineCtx *ctx) | |||
517 | { | 517 | { |
518 | regex_ctx_destroy (ctx->children[i]); | 518 | regex_ctx_destroy (ctx->children[i]); |
519 | } | 519 | } |
520 | GNUNET_free_non_null (ctx->s); /* 's' on root node is null */ | 520 | GNUNET_free (ctx->s); /* 's' on root node is null */ |
521 | GNUNET_free (ctx->children); | 521 | GNUNET_free (ctx->children); |
522 | GNUNET_free (ctx); | 522 | GNUNET_free (ctx); |
523 | } | 523 | } |
@@ -632,7 +632,7 @@ REGEX_TEST_read_from_file (const char *filename) | |||
632 | regex = NULL; | 632 | regex = NULL; |
633 | } | 633 | } |
634 | while (offset < size); | 634 | while (offset < size); |
635 | GNUNET_free_non_null (regex); | 635 | GNUNET_free (regex); |
636 | GNUNET_free (buffer); | 636 | GNUNET_free (buffer); |
637 | 637 | ||
638 | return regexes; | 638 | return regexes; |
diff --git a/src/regex/test_regex_eval_api.c b/src/regex/test_regex_eval_api.c index 767571156..7cd081269 100644 --- a/src/regex/test_regex_eval_api.c +++ b/src/regex/test_regex_eval_api.c | |||
@@ -178,9 +178,9 @@ test_random (unsigned int rx_length, unsigned int max_str_len, | |||
178 | return result; | 178 | return result; |
179 | 179 | ||
180 | error: | 180 | error: |
181 | GNUNET_free_non_null (matching_str); | 181 | GNUNET_free (matching_str); |
182 | GNUNET_free_non_null (rand_rx); | 182 | GNUNET_free (rand_rx); |
183 | GNUNET_free_non_null (canonical_regex); | 183 | GNUNET_free (canonical_regex); |
184 | return -1; | 184 | return -1; |
185 | } | 185 | } |
186 | 186 | ||
@@ -371,7 +371,7 @@ main (int argc, char *argv[]) | |||
371 | REGEX_INTERNAL_automaton_destroy (a); | 371 | REGEX_INTERNAL_automaton_destroy (a); |
372 | if (0 != check_dfa) | 372 | if (0 != check_dfa) |
373 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "check_proof: %s\n", check_proof); | 373 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "check_proof: %s\n", check_proof); |
374 | GNUNET_free_non_null (check_proof); | 374 | GNUNET_free (check_proof); |
375 | 375 | ||
376 | regfree (&rx); | 376 | regfree (&rx); |
377 | } | 377 | } |