ebb439
From 35864ac03e30fb69bafce90b49ada2f9da6eec86 Mon Sep 17 00:00:00 2001
ebb439
From: Ilya Maximets <i.maximets@ovn.org>
ebb439
Date: Fri, 20 Nov 2020 01:17:21 +0100
ebb439
Subject: [PATCH 13/16] ovn-nbctl: Fix leak of IPs while configuring NAT.
ebb439
ebb439
CC: Ankur Sharma <ankur.sharma@nutanix.com>
ebb439
Fixes: 20bc58a67f39 ("External IP based NAT: Add Columns and CLI")
ebb439
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
ebb439
Acked-by: Dumitru Ceara <dceara@redhat.com>
ebb439
Acked-by: Ankur Sharma <ankur.sharma@nutanix.com>
ebb439
Signed-off-by: Numan Siddique <numans@ovn.org>
ebb439
ebb439
(cherry-picked from master commit f9e449fce78b2e0682cef53ba09cade492b4d260)
ebb439
---
ebb439
 utilities/ovn-nbctl.c | 3 +++
ebb439
 1 file changed, 3 insertions(+)
ebb439
ebb439
diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
ebb439
index f4c4f9385..6f5117876 100644
ebb439
--- a/utilities/ovn-nbctl.c
ebb439
+++ b/utilities/ovn-nbctl.c
ebb439
@@ -4601,8 +4601,11 @@ nbctl_lr_nat_set_ext_ips(struct ctl_context *ctx)
ebb439
             } else {
ebb439
                 nbrec_nat_set_allowed_ext_ips(nat, addr_set);
ebb439
             }
ebb439
+            free(nat_ip);
ebb439
+            free(old_ip);
ebb439
             return;
ebb439
         }
ebb439
+        free(old_ip);
ebb439
     }
ebb439
 
ebb439
     if (!nat_found) {
ebb439
-- 
ebb439
2.28.0
ebb439