diff --git a/libselinux/src/regex.c b/libselinux/src/regex.c index 56694d1ee..69d40044c 100644 --- a/libselinux/src/regex.c +++ b/libselinux/src/regex.c @@ -29,6 +29,12 @@ #endif +/** + * This constructor function allocates a buffer for a regex_data structure. + * The buffer is being initialized with zeroes. + */ +static struct regex_data *regex_data_create(void); + #ifdef USE_PCRE2 char const *regex_arch_string(void) { @@ -283,7 +289,7 @@ int regex_cmp(const struct regex_data *regex1, const struct regex_data *regex2) return SELABEL_EQUAL; } -struct regex_data *regex_data_create(void) +static struct regex_data *regex_data_create(void) { struct regex_data *regex_data = (struct regex_data *)calloc(1, sizeof(struct regex_data)); @@ -524,7 +530,7 @@ int regex_cmp(const struct regex_data *regex1, const struct regex_data *regex2) return SELABEL_EQUAL; } -struct regex_data *regex_data_create(void) +static struct regex_data *regex_data_create(void) { return (struct regex_data *)calloc(1, sizeof(struct regex_data)); } diff --git a/libselinux/src/regex.h b/libselinux/src/regex.h index d449b1e70..0bff344de 100644 --- a/libselinux/src/regex.h +++ b/libselinux/src/regex.h @@ -55,11 +55,6 @@ char const *regex_arch_string(void) ; * It may return NULL on error. */ char const *regex_version(void) ; -/** - * This constructor function allocates a buffer for a regex_data structure. - * The buffer is being initialized with zeroes. - */ -struct regex_data *regex_data_create(void) ; /** * This complementary destructor function frees the a given regex_data buffer. * It also frees any non NULL member pointers with the appropriate pcreX_X_free