summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2018-05-29 19:13:51 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-06-06 18:16:12 +0200
commit5d806ec6e0bce5f1cd32b0d5386c1ad97c31c1f8 (patch)
treec025730971c6c8eb3351b439659a8a36b0e0369d /vtysh
parentlib: add vector_remove() to vector.[ch] (diff)
downloadfrr-5d806ec6e0bce5f1cd32b0d5386c1ad97c31c1f8.tar.xz
frr-5d806ec6e0bce5f1cd32b0d5386c1ad97c31c1f8.zip
lib: fix static analysis issues, use regfree()
* Fix potential NULL dereference * Fix use of uninitialized value * Fix leaking memory by not freeing regex_t * Fix extra \n when using empty regex filter * Clean up still-reachable hook memory * Handle nonexistent pager Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index cd47ef1c4..d28c879d5 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -70,6 +70,9 @@ static FILE *vty_open_pager(struct vty *vty)
if (vty->is_paged)
return vty->of;
+ if (!vtysh_pager_name)
+ return NULL;
+
vty->of_saved = vty->of;
vty->of = popen(vtysh_pager_name, "w");
if (vty->of == NULL) {