file: free memory after opendir()
authorLuka Perkov <luka@openwrt.org>
Tue, 10 Mar 2015 17:00:03 +0000 (18:00 +0100)
committerJohn Crispin <blogic@openwrt.org>
Wed, 11 Mar 2015 15:25:41 +0000 (16:25 +0100)
Signed-off-by: Luka Perkov <luka@openwrt.org>
file.c

diff --git a/file.c b/file.c
index 9a3dfd8b3d60b0992a1fc3a86db78462034b8356..31a937dec0dc975104c471a18e3c91e48f3e421b 100644 (file)
--- a/file.c
+++ b/file.c
@@ -267,6 +267,8 @@ rpc_file_list(struct ubus_context *ctx, struct ubus_object *obj,
                blobmsg_close_table(&buf, d);
        }
 
+       closedir(fd);
+
        blobmsg_close_array(&buf, c);
        ubus_send_reply(ctx, req, buf.head);
        blob_buf_free(&buf);