From: Alan T. DeKok Date: Mon, 28 Aug 2023 21:46:04 +0000 (-0400) Subject: shut up static analyzer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=555c154df80f8ea03470565be6b78500e30eb892;p=thirdparty%2Ffreeradius-server.git shut up static analyzer --- diff --git a/src/lib/util/regex.c b/src/lib/util/regex.c index 011e8685ec1..ed62dc41883 100644 --- a/src/lib/util/regex.c +++ b/src/lib/util/regex.c @@ -359,6 +359,10 @@ int regex_exec(regex_t *preg, char const *subject, size_t len, fr_regmatch_t *re * fails when passed NULL match data. */ if (!regmatch) { +#ifdef STATIC_ANALYZER + if (!preg->compiled) return -1; +#endif + match_data = pcre2_match_data_create_from_pattern(preg->compiled, fr_pcre2_tls->gcontext); if (!match_data) { fr_strerror_const("Failed allocating temporary match data");