diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c index 39eff97..461b8ee 100644 --- a/bus/dir-watch-inotify.c +++ b/bus/dir-watch-inotify.c @@ -259,7 +259,13 @@ _init_inotify (BusContext *context) goto out; } - _dbus_register_shutdown_func (_shutdown_inotify, NULL); + if (!_dbus_register_shutdown_func (_shutdown_inotify, NULL)) + { + _dbus_warn ("Unable to register shutdown func"); + _dbus_watch_unref (watch); + watch = NULL; + goto out; + } } ret = 1;