swconfig: swlib.c: remove const qualifier for val.s since this is supposed to be...
[openwrt/openwrt.git] / package / network / config / swconfig / src / swlib.c
index 122250256d7497af9dd4418e270ea43b9591a9cb..f74c093ef4ea4490f69a5d3f8f73ff09a90b7bdb 100644 (file)
@@ -363,7 +363,7 @@ int swlib_set_attr_string(struct switch_dev *dev, struct switch_attr *a, int por
                val.value.i = atoi(str);
                break;
        case SWITCH_TYPE_STRING:
                val.value.i = atoi(str);
                break;
        case SWITCH_TYPE_STRING:
-               val.value.s = str;
+               val.value.s = (char *)str;
                break;
        case SWITCH_TYPE_PORTS:
                ports = alloca(sizeof(struct switch_port) * dev->ports);
                break;
        case SWITCH_TYPE_PORTS:
                ports = alloca(sizeof(struct switch_port) * dev->ports);
@@ -761,6 +761,8 @@ swlib_free(struct switch_dev *dev)
        swlib_free_attributes(&dev->ops);
        swlib_free_attributes(&dev->port_ops);
        swlib_free_attributes(&dev->vlan_ops);
        swlib_free_attributes(&dev->ops);
        swlib_free_attributes(&dev->port_ops);
        swlib_free_attributes(&dev->vlan_ops);
+       free(dev->name);
+       free(dev->alias);
        free(dev);
 
        if (--refcount == 0)
        free(dev);
 
        if (--refcount == 0)