]> git.proxmox.com Git - mirror_frr.git/commitdiff
pbrd: remove pbr-policy resource leak
authorQuentin Young <qlyoung@cumulusnetworks.com>
Tue, 17 Apr 2018 21:51:48 +0000 (17:51 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 18 Apr 2018 16:16:19 +0000 (12:16 -0400)
Removing a non-existent pbr-policy caused a pbr_interface to leak.

Coverity #1467829

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
pbrd/pbr_vty.c

index f598b2645c656e821123bb45ec95ff8bee7047e2..16ae0ee2b3e8a0381cff95af0838a6b6ff516929 100644 (file)
@@ -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);
        }