ubusd: fix a memory leak on user/group client info

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
Felix Fietkau 2016-01-26 10:10:39 +01:00
parent 8bb34756ce
commit 619f3a160d
3 changed files with 9 additions and 0 deletions

View file

@ -174,6 +174,13 @@ ubusd_acl_init_client(struct ubus_client *cl, int fd)
return 0;
}
void
ubusd_acl_free_client(struct ubus_client *cl)
{
free(cl->group);
free(cl->user);
}
static void
ubusd_acl_file_free(struct ubusd_acl_file *file)
{

View file

@ -22,6 +22,7 @@ enum ubusd_acl_type {
int ubusd_acl_check(struct ubus_client *cl, const char *obj, const char *method, enum ubusd_acl_type type);
int ubusd_acl_init_client(struct ubus_client *cl, int fd);
void ubusd_acl_free_client(struct ubus_client *cl);
void ubusd_acl_load(void);
#endif

View file

@ -500,6 +500,7 @@ void ubusd_proto_free_client(struct ubus_client *cl)
ubusd_free_object(obj);
}
ubusd_acl_free_client(cl);
ubus_free_id(&clients, &cl->id);
}