summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 2d8112727a..280b2ace51 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -120,9 +120,11 @@ bool vty_set_include(struct vty *vty, const char *regexp)
bool ret = true;
char errbuf[256];
- if (!regexp && vty->filter) {
- regfree(&vty->include);
- vty->filter = false;
+ if (!regexp) {
+ if (vty->filter) {
+ regfree(&vty->include);
+ vty->filter = false;
+ }
return true;
}