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

source3/nmbd/nmbd_subnetdb.c

index 3b9be2c2ce9ca55da007773694a1f93ca24eac9d..04df3e9a4f9e07257ab9fa26cc1ab7dbe6c5a19d 100644 (file)
@@ -203,6 +203,11 @@ BOOL create_subnets(void)
        for (i = 0 ; i < num_interfaces; i++) {
                struct interface *iface = get_interface(i);
 
+               if (!iface) {
+                       DEBUG(2,("create_subnets: can't get interface %d.\n", i ));
+                       continue;
+               }
+
                /*
                 * We don't want to add a loopback interface, in case
                 * someone has added 127.0.0.1 for smbd, nmbd needs to