SCP: Avoid potential memory leak while cleaning up EXPECT regular expressions
This commit is contained in:
parent
f86a67310a
commit
195cd439ae
1 changed files with 4 additions and 0 deletions
4
scp.c
4
scp.c
|
@ -11633,6 +11633,10 @@ for (i=0; i<exp->size; i++) {
|
|||
free (exp->rules[i].match); /* deallocate match string */
|
||||
free (exp->rules[i].match_pattern); /* deallocate display format match string */
|
||||
free (exp->rules[i].act); /* deallocate action */
|
||||
#if defined(USE_REGEX)
|
||||
if (exp->rules[i].switches & EXP_TYP_REGEX)
|
||||
regfree (&exp->rules[i].regex); /* release compiled regex */
|
||||
#endif
|
||||
}
|
||||
free (exp->rules);
|
||||
exp->rules = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue