tnl-ports: Free "ip_dev" on error.
authorJustin Pettit <jpettit@nicira.com>
Thu, 22 Oct 2015 06:49:10 +0000 (23:49 -0700)
committerJustin Pettit <jpettit@nicira.com>
Fri, 23 Oct 2015 01:00:16 +0000 (18:00 -0700)
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
lib/tnl-ports.c

index c82f018..77cf5bb 100644 (file)
@@ -364,11 +364,13 @@ insert_ipdev(const char dev_name[])
     ip_dev->change_seq = netdev_get_change_seq(dev);
     error = netdev_get_etheraddr(ip_dev->dev, &ip_dev->mac);
     if (error) {
+        free(ip_dev);
         return;
     }
     error4 = netdev_get_in4(ip_dev->dev, (struct in_addr *)&ip_dev->addr4, NULL);
     error6 = netdev_get_in6(ip_dev->dev, &ip_dev->addr6);
     if (error4 && error6) {
+        free(ip_dev);
         return;
     }
     ovs_strlcpy(ip_dev->dev_name, netdev_get_name(dev), sizeof ip_dev->dev_name);