Skip to content

Commit 6fe8d73

Browse files
authored
Merge pull request #430 from bazsi/filterx-avoid-excessive-memset-in-regexp-common
filterx/expr-regexp-common: avoid excessive zero initialization of FilterXReMatchState
2 parents 82cc295 + de94a2e commit 6fe8d73

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/filterx/expr-regexp-common.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ filterx_regexp_compile_pattern_defaults(const gchar *pattern)
6969
void
7070
filterx_expr_rematch_state_init(FilterXReMatchState *state)
7171
{
72-
memset(state, 0, sizeof(FilterXReMatchState));
72+
state->match_data = NULL;
73+
state->lhs_obj = NULL;
7374
}
7475

7576
void
@@ -78,7 +79,6 @@ filterx_expr_rematch_state_cleanup(FilterXReMatchState *state)
7879
if (state->match_data)
7980
pcre2_match_data_free(state->match_data);
8081
filterx_object_unref(state->lhs_obj);
81-
memset(state, 0, sizeof(FilterXReMatchState));
8282
}
8383

8484
gboolean

0 commit comments

Comments
 (0)