diff mbox

[OpenWrt-Devel,4/4] swconfig: swlib.c: free name and description of attributes

Message ID 1434642649-20330-4-git-send-email-ardeleanalex@gmail.com
State Accepted
Headers show

Commit Message

Alexandru Ardelean June 18, 2015, 3:50 p.m. UTC
From: Alexandru Ardelean <aa@ocedo.com>

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
---
 package/network/config/swconfig/src/swlib.c | 2 ++
 package/network/config/swconfig/src/swlib.h | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c
index 1e0a7db..dae603c 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 2b42c14..7edece3 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;
 };