struct nlif_handle *nlif_open(void) { .......... if (rtnl_handler_register(h->rtnl_handle, &h->ifadd_handler) < 0) goto err_close; if (rtnl_handler_register(h->rtnl_handle, &h->ifdel_handler) < 0) goto err_unregister; return h; err_unregister: rtnl_handler_unregister(h->rtnl_handle, &h->ifdel_handler); err_close: rtnl_close(h->rtnl_handle); free(h); err: return NULL; } Here if was error after rtnl_handler_register(... ifdel_handler...) need to unregister the ifadd_handler, but in err_unregister: try to unregister the the ifdel_handler.
Attachment:
2.patch
Description: Binary data