mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-29 13:43:07 +00:00
FS-11903: Fix errors reported by PVS-Studio Static Code Analyzer for switch_regex.c
This commit is contained in:
parent
04c8e06196
commit
b5d8ffcb5e
@ -75,7 +75,7 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
|
|||||||
if (*expression == '/') {
|
if (*expression == '/') {
|
||||||
char *opts = NULL;
|
char *opts = NULL;
|
||||||
tmp = strdup(expression + 1);
|
tmp = strdup(expression + 1);
|
||||||
assert(tmp);
|
switch_assert(tmp);
|
||||||
if ((opts = strrchr(tmp, '/'))) {
|
if ((opts = strrchr(tmp, '/'))) {
|
||||||
*opts++ = '\0';
|
*opts++ = '\0';
|
||||||
} else {
|
} else {
|
||||||
@ -85,7 +85,7 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
expression = tmp;
|
expression = tmp;
|
||||||
if (opts) {
|
if (*opts) {
|
||||||
if (strchr(opts, 'i')) {
|
if (strchr(opts, 'i')) {
|
||||||
flags |= PCRE_CASELESS;
|
flags |= PCRE_CASELESS;
|
||||||
}
|
}
|
||||||
@ -227,7 +227,7 @@ SWITCH_DECLARE(switch_status_t) switch_regex_match_partial(const char *target, c
|
|||||||
if (*expression == '/') {
|
if (*expression == '/') {
|
||||||
char *opts = NULL;
|
char *opts = NULL;
|
||||||
tmp = strdup(expression + 1);
|
tmp = strdup(expression + 1);
|
||||||
assert(tmp);
|
switch_assert(tmp);
|
||||||
if ((opts = strrchr(tmp, '/'))) {
|
if ((opts = strrchr(tmp, '/'))) {
|
||||||
*opts++ = '\0';
|
*opts++ = '\0';
|
||||||
} else {
|
} else {
|
||||||
@ -237,7 +237,7 @@ SWITCH_DECLARE(switch_status_t) switch_regex_match_partial(const char *target, c
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
expression = tmp;
|
expression = tmp;
|
||||||
if (opts) {
|
if (*opts) {
|
||||||
if (strchr(opts, 'i')) {
|
if (strchr(opts, 'i')) {
|
||||||
flags |= PCRE_CASELESS;
|
flags |= PCRE_CASELESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user