Fix kassert panic when inserting multipath routes from multiple threads.

Reported by:	Marco Zec <zec at fer.hr>
MFC after:	immediately
This commit is contained in:
Alexander V. Chernikov 2021-03-21 18:15:29 +00:00
parent 57b9a062d1
commit 2476178e6b

View File

@ -488,7 +488,9 @@ get_nhgrp(struct nh_control *ctl, struct weightened_nhop *wn, int num_nhops,
if (link_nhgrp(ctl, key) == 0) {
/* Unable to allocate index? */
*perror = EAGAIN;
destroy_nhgrp(key);
free_nhgrp_nhops(key);
destroy_nhgrp_int(key);
return (NULL);
}
*perror = 0;
return (key);