From 18d72306a98ea87d1ced9101ffc8a4f15a7e3f83 Mon Sep 17 00:00:00 2001
From: blogic <blogic@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Tue, 7 Jul 2015 13:46:16 +0000
Subject: [PATCH] swconfig: swlib.c: free name and description of attributes

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46232 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 package/network/config/swconfig/src/swlib.c | 2 ++
 package/network/config/swconfig/src/swlib.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c
index d7e570e05d..d9ef62f4ab 100644
--- a/package/network/config/swconfig/src/swlib.c
+++ b/package/network/config/swconfig/src/swlib.c
@@ -749,6 +749,8 @@ swlib_free_attributes(struct switch_attr **head)
 
 	while (a) {
 		next = a->next;
+		free(a->name);
+		free(a->description);
 		free(a);
 		a = next;
 	}
diff --git a/package/network/config/swconfig/src/swlib.h b/package/network/config/swconfig/src/swlib.h
index 2b42c14760..7edece3cc6 100644
--- a/package/network/config/swconfig/src/swlib.h
+++ b/package/network/config/swconfig/src/swlib.h
@@ -146,8 +146,8 @@ struct switch_attr {
 	int atype;
 	int id;
 	int type;
-	const char *name;
-	const char *description;
+	char *name;
+	char *description;
 	struct switch_attr *next;
 };
 
-- 
GitLab