Blob Blame History Raw
From 35864ac03e30fb69bafce90b49ada2f9da6eec86 Mon Sep 17 00:00:00 2001
From: Ilya Maximets <i.maximets@ovn.org>
Date: Fri, 20 Nov 2020 01:17:21 +0100
Subject: [PATCH 13/16] ovn-nbctl: Fix leak of IPs while configuring NAT.

CC: Ankur Sharma <ankur.sharma@nutanix.com>
Fixes: 20bc58a67f39 ("External IP based NAT: Add Columns and CLI")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>
Acked-by: Ankur Sharma <ankur.sharma@nutanix.com>
Signed-off-by: Numan Siddique <numans@ovn.org>

(cherry-picked from master commit f9e449fce78b2e0682cef53ba09cade492b4d260)
---
 utilities/ovn-nbctl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/utilities/ovn-nbctl.c b/utilities/ovn-nbctl.c
index f4c4f9385..6f5117876 100644
--- a/utilities/ovn-nbctl.c
+++ b/utilities/ovn-nbctl.c
@@ -4601,8 +4601,11 @@ nbctl_lr_nat_set_ext_ips(struct ctl_context *ctx)
             } else {
                 nbrec_nat_set_allowed_ext_ips(nat, addr_set);
             }
+            free(nat_ip);
+            free(old_ip);
             return;
         }
+        free(old_ip);
     }
 
     if (!nat_found) {
-- 
2.28.0