mirror of
https://github.com/simh/simh.git
synced 2026-01-25 19:56:25 +00:00
SCP: Avoid potential memory leak while cleaning up EXPECT regular expressions
This commit is contained in:
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;
|
||||
|
||||
Reference in New Issue
Block a user