[OpenWrt-Devel,rpcd,v2,4/6] uci: free configs list memory on return
diff mbox series

Message ID 20191021061031.81230-5-yszhou4tech@gmail.com
State Accepted
Headers show
Series
  • memory issue fixes
Related show

Commit Message

Yousong Zhou Oct. 21, 2019, 6:10 a.m. UTC
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
 uci.c | 2 ++
 1 file changed, 2 insertions(+)

Patch
diff mbox series

diff --git a/uci.c b/uci.c
index 1587a19..7667505 100644
--- a/uci.c
+++ b/uci.c
@@ -1284,6 +1284,7 @@  rpc_uci_changes(struct ubus_context *ctx, struct ubus_object *obj,
 
 		uci_unload(cursor, p);
 	}
+	free(configs);
 
 	blobmsg_close_table(&buf, c);
 
@@ -1388,6 +1389,7 @@  rpc_uci_configs(struct ubus_context *ctx, struct ubus_object *obj,
 
 	for (i = 0; configs[i]; i++)
 		blobmsg_add_string(&buf, NULL, configs[i]);
+	free(configs);
 
 	blobmsg_close_array(&buf, c);