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

Yousong Zhou yszhou4tech at gmail.com
Mon Oct 21 02:10:29 EDT 2019


Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 uci.c | 2 ++
 1 file changed, 2 insertions(+)

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

_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list