[td-98] fix uninitialized value access warning by valgrind.

This commit is contained in:
hjxilinx 2020-04-11 23:37:50 +08:00
parent 39a0443ee3
commit ea497f20a3
2 changed files with 3 additions and 1 deletions

View File

@ -284,7 +284,7 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
/* Function to do regular expression check */
int regex_match(const char *s, const char *reg, int cflags) {
regex_t regex;
char msgbuf[100];
char msgbuf[100] = {0};
/* Compile regular expression */
if (regcomp(&regex, reg, cflags) != 0) {

View File

@ -97,6 +97,8 @@ int main(int argc, char* argv[]) {
/* Interupt handler. */
struct sigaction act;
memset(&act, 0, sizeof(struct sigaction));
act.sa_handler = interruptHandler;
sigaction(SIGTERM, &act, NULL);
sigaction(SIGINT, &act, NULL);