This makes sure that even if the srvids are not deregistered, the header
structure is freed when the last message handler has been freed as a result of
client going away.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit
4e1ec7412866f2d31c41de1bec0fbf788c03051b)
struct ctdb_message_list_header *h = m->h;
DLIST_REMOVE(h->m, m);
+ if (h->m == NULL) {
+ talloc_free(h);
+ }
return 0;
}
for (m=h->m; m; m=m->next) {
if (m->message_private == private_data) {
talloc_free(m);
- if (h->m == NULL) {
- talloc_free(h);
- }
return 0;
}
}