X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=package%2Fnetwork%2Fconfig%2Fswconfig%2Fsrc%2Fswlib.c;h=f74c093ef4ea4490f69a5d3f8f73ff09a90b7bdb;hp=122250256d7497af9dd4418e270ea43b9591a9cb;hb=2b9bdf4d6f665db76dc3f56efb2bb74fe2a7a3d0;hpb=d1156bca0a2e3981aad62d6cc9155f71c01c3915 diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index 122250256d..f74c093ef4 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -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.s = str; + val.value.s = (char *)str; 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); + free(dev->name); + free(dev->alias); free(dev); if (--refcount == 0)