Skip to content

Commit 6f82fe7

Browse files
committed
DISPATCH-1723: Free any link_work items still in the link->work_list and free that associated error object as well. This closes #1067.
1 parent 3fa6135 commit 6f82fe7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/router_core/router_core.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,21 @@ void qdr_core_free(qdr_core_t *core)
234234
free(link->insert_prefix);
235235
free(link->strip_prefix);
236236
link->name = 0;
237+
238+
//
239+
// If there are still any work items remaining in the link->work_list
240+
// remove them and free the associated link_work->error
241+
//
242+
sys_mutex_lock(link->conn->work_lock);
243+
qdr_link_work_t *link_work = DEQ_HEAD(link->work_list);
244+
while (link_work) {
245+
DEQ_REMOVE_HEAD(link->work_list);
246+
qdr_error_free(link_work->error);
247+
free_qdr_link_work_t(link_work);
248+
link_work = DEQ_HEAD(link->work_list);
249+
}
250+
sys_mutex_unlock(link->conn->work_lock);
251+
237252
free_qdr_link_t(link);
238253
link = DEQ_HEAD(core->open_links);
239254
}

0 commit comments

Comments
 (0)