gtpu: fix memory leak 24/35924/2
authorLeung Lai Yung <benkerbuild@gmail.com>
Sat, 9 Apr 2022 10:45:12 +0000 (10:45 +0000)
committerMatthew Smith <mgsmith@netgate.com>
Thu, 14 Apr 2022 17:56:09 +0000 (17:56 +0000)
Type: fix

Free the old rewrite string before assigning a new rewrite string for the updated new tteid value.

Signed-off-by: Leung Lai Yung <benkerbuild@gmail.com>
Change-Id: I1ec19bce6afda3dfdc31c8724b32ac7b9bc84e89

src/plugins/gtpu/gtpu.c

index 33af26d..086a4b5 100644 (file)
@@ -578,6 +578,7 @@ int vnet_gtpu_add_mod_del_tunnel
          if (a->tteid == 0)
            return VNET_API_ERROR_INVALID_VALUE;
          t->tteid = a->tteid;
+         vec_free (t->rewrite);
          ip_udp_gtpu_rewrite (t, is_ip6);
          return 0;
        }