file: free memory after opendir()

Signed-off-by: Luka Perkov <luka@openwrt.org>
This commit is contained in:
Luka Perkov 2015-03-10 18:00:03 +01:00 committed by John Crispin
parent b65f6a844f
commit 361b823e8d

2
file.c
View file

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