[td-98] fix uninitialized value access warning by valgrind.
This commit is contained in:
parent
39a0443ee3
commit
ea497f20a3
|
@ -284,7 +284,7 @@ void shellRunCommandOnServer(TAOS *con, char command[]) {
|
||||||
/* Function to do regular expression check */
|
/* Function to do regular expression check */
|
||||||
int regex_match(const char *s, const char *reg, int cflags) {
|
int regex_match(const char *s, const char *reg, int cflags) {
|
||||||
regex_t regex;
|
regex_t regex;
|
||||||
char msgbuf[100];
|
char msgbuf[100] = {0};
|
||||||
|
|
||||||
/* Compile regular expression */
|
/* Compile regular expression */
|
||||||
if (regcomp(®ex, reg, cflags) != 0) {
|
if (regcomp(®ex, reg, cflags) != 0) {
|
||||||
|
|
|
@ -97,6 +97,8 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
/* Interupt handler. */
|
/* Interupt handler. */
|
||||||
struct sigaction act;
|
struct sigaction act;
|
||||||
|
memset(&act, 0, sizeof(struct sigaction));
|
||||||
|
|
||||||
act.sa_handler = interruptHandler;
|
act.sa_handler = interruptHandler;
|
||||||
sigaction(SIGTERM, &act, NULL);
|
sigaction(SIGTERM, &act, NULL);
|
||||||
sigaction(SIGINT, &act, NULL);
|
sigaction(SIGINT, &act, NULL);
|
||||||
|
|
Loading…
Reference in New Issue