diff options
author | John Crispin <john@openwrt.org> | 2015-07-07 13:46:05 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2015-07-07 13:46:05 +0000 |
commit | 294907aa3ab96d8fbee05082ef4db3f886eb0321 (patch) | |
tree | d47deffdacf2b2389cac2283cc7299ab09cf9fbb /package/network/config/swconfig/src/swlib.c | |
parent | 2b9bdf4d6f665db76dc3f56efb2bb74fe2a7a3d0 (diff) | |
download | master-31e0f0ae-294907aa3ab96d8fbee05082ef4db3f886eb0321.tar.gz master-31e0f0ae-294907aa3ab96d8fbee05082ef4db3f886eb0321.tar.bz2 master-31e0f0ae-294907aa3ab96d8fbee05082ef4db3f886eb0321.zip |
swconfig: swlib.c: free portmaps in swlib_free()
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
SVN-Revision: 46231
Diffstat (limited to 'package/network/config/swconfig/src/swlib.c')
-rw-r--r-- | package/network/config/swconfig/src/swlib.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index f74c093ef4..d7e570e05d 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -755,12 +755,26 @@ swlib_free_attributes(struct switch_attr **head) *head = NULL; } +static void +swlib_free_port_map(struct switch_dev *dev) +{ + int i; + + if (!dev || !dev->maps) + return; + + for (i = 0; i < dev->ports; i++) + free(dev->maps[i].segment); + free(dev->maps); +} + void 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_port_map(dev); free(dev->name); free(dev->alias); free(dev); |