Merge pull request #13193 from Keelan10/link_state-memory-leak

lib: link state leak fix
This commit is contained in:
Jafar Al-Gharaibeh 2023-04-12 10:57:34 -05:00 committed by GitHub
commit dde1018745
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1907,6 +1907,20 @@ void ls_delete_msg(struct ls_message *msg)
if (msg == NULL)
return;
if (msg->event == LS_MSG_EVENT_DELETE) {
switch (msg->type) {
case LS_MSG_TYPE_NODE:
ls_node_del(msg->data.node);
break;
case LS_MSG_TYPE_ATTRIBUTES:
ls_attributes_del(msg->data.attr);
break;
case LS_MSG_TYPE_PREFIX:
ls_prefix_del(msg->data.prefix);
break;
}
}
XFREE(MTYPE_LS_DB, msg);
}