[icmpv6] fix resource leak of icmpv6

Signed-off-by: meijian <meijian@xiaomi.com>
This commit is contained in:
meijian 2024-03-06 10:45:54 +08:00 committed by Xiang Xiao
parent d1789d84e8
commit 98d5e118c0
1 changed files with 6 additions and 0 deletions

View File

@ -392,6 +392,12 @@ got_lladdr:
ret = icmpv6_send_message(dev, false); ret = icmpv6_send_message(dev, false);
if (ret < 0) if (ret < 0)
{ {
/* Remove our wait structure from the list (we may no longer be
* at the head of the list).
*/
icmpv6_rwait_cancel(&notify);
nerr("ERROR: Failed send router solicitation: %d\n", ret); nerr("ERROR: Failed send router solicitation: %d\n", ret);
break; break;
} }