ubusd: fix a memory leak on user/group client info
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
8bb34756ce
commit
619f3a160d
3 changed files with 9 additions and 0 deletions
|
@ -174,6 +174,13 @@ ubusd_acl_init_client(struct ubus_client *cl, int fd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ubusd_acl_free_client(struct ubus_client *cl)
|
||||||
|
{
|
||||||
|
free(cl->group);
|
||||||
|
free(cl->user);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ubusd_acl_file_free(struct ubusd_acl_file *file)
|
ubusd_acl_file_free(struct ubusd_acl_file *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_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);
|
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);
|
void ubusd_acl_load(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -500,6 +500,7 @@ void ubusd_proto_free_client(struct ubus_client *cl)
|
||||||
ubusd_free_object(obj);
|
ubusd_free_object(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ubusd_acl_free_client(cl);
|
||||||
ubus_free_id(&clients, &cl->id);
|
ubus_free_id(&clients, &cl->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue