diff --git a/src/kit/shell/src/shellWindows.c b/src/kit/shell/src/shellWindows.c index 9c778491ccb280861f6be364c783104a9151c531..87d11a3516a65e83201bf4ebe51f07e5394d5cdf 100644 --- a/src/kit/shell/src/shellWindows.c +++ b/src/kit/shell/src/shellWindows.c @@ -206,8 +206,12 @@ int isReadyGo(Command *cmd) { char *reg_str = "(^.*;\\s*$)|(^\\s*$)|(^\\s*exit\\s*$)|(^\\s*q\\s*$)|(^\\s*quit\\s*$)|(^" "\\s*clear\\s*$)"; - if (regex_match(total, reg_str, REG_EXTENDED | REG_ICASE)) return 1; + if (regex_match(total, reg_str, REG_EXTENDED | REG_ICASE)) { + free(total); + return 1; + } + free(total); return 0; }