diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
index 2a2c2a3..b663d3a 100644
--- a/src/shared/mgmt.c
+++ b/src/shared/mgmt.c
{
struct mgmt *mgmt = user_data;
- if (mgmt->destroyed)
+ if (mgmt->destroyed) {
+ queue_destroy(mgmt->notify_list, NULL);
+ queue_destroy(mgmt->pending_list, NULL);
free(mgmt);
+ }
}
static bool can_read_data(struct io *io, void *user_data)
mgmt->buf = NULL;
if (!mgmt->in_notify) {
+ queue_destroy(mgmt->notify_list, NULL);
+ queue_destroy(mgmt->pending_list, NULL);
free(mgmt);
return;
}