ebb439
From dff5ff1175d2c1f2a2619276aa287ecdeac04702 Mon Sep 17 00:00:00 2001
ebb439
From: Ilya Maximets <i.maximets@ovn.org>
ebb439
Date: Fri, 20 Nov 2020 01:17:22 +0100
ebb439
Subject: [PATCH 14/16] ovn-nbctl: Fix IP leak on router NAT addition failure.
ebb439
ebb439
Cleanup needed instead of direct return.
ebb439
ebb439
Fixes: 43f42ecb3a5a ("Use normalized IP addreses in `ovn-nbctl lr-nat-add`")
ebb439
Acked-by: Dumitru Ceara <dceara@redhat.com>
ebb439
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
ebb439
Signed-off-by: Numan Siddique <numans@ovn.org>
ebb439
ebb439
(cherry-picked from master commit 360b5bf20f23eb103edf86f3b13ab0a5fe0490db)
ebb439
---
ebb439
 utilities/ovn-nbctl.c | 2 +-
ebb439
 1 file changed, 1 insertion(+), 1 deletion(-)
ebb439
ebb439
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
ebb439
index 6f5117876..af9b396c3 100644
ebb439
--- a/utilities/ovn-nbctl.c
ebb439
+++ b/utilities/ovn-nbctl.c
ebb439
@@ -4311,7 +4311,7 @@ nbctl_lr_nat_add(struct ctl_context *ctx)
ebb439
 
ebb439
     if (strcmp(nat_type, "dnat_and_snat") && stateless) {
ebb439
         ctl_error(ctx, "stateless is not applicable to dnat or snat types");
ebb439
-        return;
ebb439
+        goto cleanup;
ebb439
     }
ebb439
 
ebb439
     int is_snat = !strcmp("snat", nat_type);
ebb439
-- 
ebb439
2.28.0
ebb439