summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2019-10-21 06:10:29 +0000
committerJo-Philipp Wich <jo@mein.io>2020-05-26 16:16:50 +0200
commitdd46d6dfc3ed3c8caefafdf1be46a726c1edb98f (patch)
treefedfd4363b7978818e72dfc76e82999aaf31f7a4
parentabbc3020dcfb6ed7dcbcf8eaf27e17a8fc9df83c (diff)
downloadrpcd-dd46d6dfc3ed3c8caefafdf1be46a726c1edb98f.tar.gz
uci: free configs list memory on return
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com> [fix whitespace] Signed-off-by: Jo-Philipp Wich <jo@mein.io> (cherry picked from commit 9ecfada16d7ad5ae942e6c0e65e1b9d7e89e21df)
-rw-r--r--uci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/uci.c b/uci.c
index 0de6f3e..522c24e 100644
--- a/uci.c
+++ b/uci.c
@@ -1286,6 +1286,8 @@ rpc_uci_changes(struct ubus_context *ctx, struct ubus_object *obj,
uci_unload(cursor, p);
}
+ free(configs);
+
blobmsg_close_table(&buf, c);
ubus_send_reply(ctx, req, buf.head);
@@ -1390,6 +1392,8 @@ 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);
ubus_send_reply(ctx, req, buf.head);