diff --git a/src/common/backend/utils/error/elog.cpp b/src/common/backend/utils/error/elog.cpp index 237554c10..d812a2eb7 100644 --- a/src/common/backend/utils/error/elog.cpp +++ b/src/common/backend/utils/error/elog.cpp @@ -5736,7 +5736,7 @@ static void eraseSingleQuotes(char* query_string) * Report error according to the return value. * At the same time, we should free the space alloced by developers. */ -void freeSecurityFuncSpace(char* charList, ...) +void freeSecurityFuncSpace(const char* charList, ...) { va_list argptr; diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h index e918432ac..0f57e433b 100644 --- a/src/include/utils/elog.h +++ b/src/include/utils/elog.h @@ -316,7 +316,7 @@ typedef struct FormatCallStack { #define securec_check(errno, charList, ...) \ { \ if (EOK != errno) { \ - freeSecurityFuncSpace(static_cast(charList), ##__VA_ARGS__); \ + freeSecurityFuncSpace(charList, ##__VA_ARGS__); \ switch (errno) { \ case EINVAL: \ elog(ERROR, \ @@ -669,7 +669,7 @@ extern void write_stderr_with_prefix(const char* fmt, ...) extern void getElevelAndSqlstate(int* eLevel, int* sqlState); extern void get_time_now(char* nowTime, int timeLen); -void freeSecurityFuncSpace(char* charList, ...); +void freeSecurityFuncSpace(const char* charList, ...); extern void SimpleLogToServer(int elevel, bool silent, const char* fmt, ...) __attribute__((format(PG_PRINTF_ATTRIBUTE, 3, 4)));