Diff between 51e9b93d604e88a1e09ea5e20467c1fa10d5f6aa and f8754ec28b47ccf9e044ef0a20df47f7e1df78a3

Changed Files

File Additions Deletions Status
src/shared/mgmt.c +6 -1 modified

Full Patch

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
@@ -291,8 +291,11 @@ static void read_watch_destroy(void *user_data)
 {
 	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)
@@ -514,6 +517,8 @@ void mgmt_unref(struct mgmt *mgmt)
 	mgmt->buf = NULL;
 
 	if (!mgmt->in_notify) {
+		queue_destroy(mgmt->notify_list, NULL);
+		queue_destroy(mgmt->pending_list, NULL);
 		free(mgmt);
 		return;
 	}