diff mbox series

[OpenWrt-Devel,rpcd,4/4] uci: free configs list memory on return

Message ID 20191020112608.129703-4-yszhou4tech@gmail.com
State Superseded
Headers show
Series [OpenWrt-Devel,rpcd,1/4] plugin: exec: properly free memory on parse error | expand

Commit Message

Yousong Zhou Oct. 20, 2019, 11:26 a.m. UTC
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
 uci.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

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);