Skip to content
Myr

Fix memory leaks in --with-oniguruma=no implementation of f_match

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Found by LeakSanitizer running ./jq -n '"" | test("")' in a --with-oniguruma=no --enable-ubsan --enable-asan build.

authored by Emanuele Torre · committed by Nico Williams · parent 0e3c391 · Browse files · 1 file+4 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−0 removed

  • other:+4 added−0 removed

1 file+4 added−0 removed

modified:src/builtin.c+4 added
1020 unmodified lines
1021 return result;1022}1023#else /* !HAVE_LIBONIG */1024static jv f_match(jq_state *jq, jv input, jv regex, jv modifiers, jv testmode) {1025 jv_free(input);1026 jv_free(regex);1027 jv_free(modifiers);1028 jv_free(testmode);1029 return jv_invalid_with_msg(jv_string("jq was compiled without ONIGURUMA regex library. match/test/sub and related functions are not available."));1030}1031#endif /* HAVE_LIBONIG */1032
843 unmodified lines