Skip to content

Commit

Permalink
Fix valgrind errors on GRegex
Browse files Browse the repository at this point in the history
  • Loading branch information
lwindolf committed Mar 14, 2024
1 parent bb0ffb7 commit 58cd970
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
noinst_PROGRAMS = $(TEST_PROGS)

TEST_PROGS = parse_html favicon parse_date parse_rss parse_xml social
MEMCHECK_PROGS = parse_html favicon parse_date social
MEMCHECK_PROGS = $(TEST_PROGS)

test: $(TEST_PROGS)
echo $(TEST_PROGS) |\
Expand Down
3 changes: 2 additions & 1 deletion src/xml.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ xhtml_regex_add (GSList **regex, const gchar *pattern, const gchar *replace)
GError *err = NULL;
regexPtr expr = g_new0 (struct regex, 1);

expr->expr = g_regex_new (pattern, G_REGEX_CASELESS | G_REGEX_UNGREEDY | G_REGEX_DOTALL | G_REGEX_OPTIMIZE, 0, &err);
// Do not use G_REGEX_OPTIMIZE as valgrind would report errors!
expr->expr = g_regex_new (pattern, G_REGEX_CASELESS | G_REGEX_UNGREEDY | G_REGEX_DOTALL, 0, &err);
expr->replace = replace;
if (err) {
g_warning ("xhtml_strip_setup: %s\n", err->message);
Expand Down

0 comments on commit 58cd970

Please sign in to comment.