From: Lennart Poettering Date: Sun, 4 Feb 2007 17:12:18 +0000 (+0000) Subject: move assert check before access X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=bd68f1a8609d726a46e4487d016427efbc815da1;p=catta move assert check before access git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1383 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/iface-pfroute.c b/avahi-core/iface-pfroute.c index 035e267..f96bfc2 100644 --- a/avahi-core/iface-pfroute.c +++ b/avahi-core/iface-pfroute.c @@ -262,10 +262,11 @@ static void socket_event(AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent int avahi_interface_monitor_init_osdep(AvahiInterfaceMonitor *m) { int fd = -1; - m->osdep.pfroute = NULL; assert(m); + m->osdep.pfroute = NULL; + if ((fd = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0) { avahi_log_error(__FILE__": socket(PF_ROUTE): %s", strerror(errno)); goto fail;