Additional check to ensure the notify event is still valid
before calling the thread lib api.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
if (zebra_netns_notify_current->u.fd > 0)
fd = zebra_netns_notify_current->u.fd;
- thread_cancel(zebra_netns_notify_current);
- /* auto-removal of inotify items */
+
+ if (zebra_netns_notify_current->master != NULL)
+ thread_cancel(zebra_netns_notify_current);
+
+ /* auto-removal of notify items */
if (fd > 0)
close(fd);
}