From d64169679f4efccd5be63d4ca5c73b6bc41187d6 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Tue, 17 Apr 2018 17:51:48 -0400 Subject: [PATCH] pbrd: remove pbr-policy resource leak Removing a non-existent pbr-policy caused a pbr_interface to leak. Coverity #1467829 Signed-off-by: Quentin Young --- pbrd/pbr_vty.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index f598b2645c..16ae0ee2b3 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -313,10 +313,11 @@ DEFPY (pbr_policy, pbrm = pbrm_find(mapname); if (!pbr_ifp) { - /* - * Some one could have fat fingered the interface - * name - */ + /* we don't want one and we don't have one, so... */ + if (no) + return CMD_SUCCESS; + + /* Some one could have fat fingered the interface name */ pbr_ifp = pbr_if_new(ifp); }