r16576: Fix Klocwork #2015. Possible null deref.
authorJeremy Allison <jra@samba.org>
Wed, 28 Jun 2006 00:01:28 +0000 (00:01 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:19:01 +0000 (11:19 -0500)
Jeremy.
(This used to be commit 9cbfaf62a3c4bb7d2e594e412449506ab0af4063)

source3/nmbd/nmbd.c

index 9c8f99df252196e9ee6fd66173b705f4490c4f31..26495d25c13a3f6df6847f49223027ee8164adae 100644 (file)
@@ -173,6 +173,11 @@ static BOOL reload_interfaces(time_t t)
        for (n=iface_count() - 1; n >= 0; n--) {
                struct interface *iface = get_interface(n);
 
+               if (!iface) {
+                       DEBUG(2,("reload_interfaces: failed to get interface %d\n", n));
+                       continue;
+               }
+
                /*
                 * We don't want to add a loopback interface, in case
                 * someone has added 127.0.0.1 for smbd, nmbd needs to