add prelocal table to manipulate locally destinated traffic
[project/netifd.git] / vlandev.c
index 7b2038e..884e6ef 100644 (file)
--- a/vlandev.c
+++ b/vlandev.c
@@ -131,6 +131,7 @@ vlandev_free(struct device *dev)
 
        mvdev = container_of(dev, struct vlandev_device, dev);
        device_remove_user(&mvdev->parent);
+       free(mvdev->config_data);
        free(mvdev);
 }
 
@@ -185,6 +186,7 @@ vlandev_reload(struct device *dev, struct blob_attr *attr)
        struct vlandev_device *mvdev;
 
        mvdev = container_of(dev, struct vlandev_device, dev);
+       attr = blob_memdup(attr);
 
        blobmsg_parse(device_attr_list.params, __DEV_ATTR_MAX, tb_dev,
                blob_data(attr), blob_len(attr));
@@ -214,6 +216,7 @@ vlandev_reload(struct device *dev, struct blob_attr *attr)
                vlandev_config_init(dev);
        }
 
+       free(mvdev->config_data);
        mvdev->config_data = attr;
        return ret;
 }