]> git.sur5r.net Git - openldap/commitdiff
Fix uninitialized pointer bug.
authorKurt Zeilenga <kurt@openldap.org>
Sat, 3 Nov 2001 22:02:57 +0000 (22:02 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 3 Nov 2001 22:02:57 +0000 (22:02 +0000)
servers/slapd/daemon.c

index 9f2b9079684570c9f7b6724aebd88c3e408a75fb..8e6ef5b1ff66e5f056121d6b680da0432ea5554f 100644 (file)
@@ -396,6 +396,7 @@ static int slap_get_listener_addresses(
                }
 
                sap = *sal;
+               *sap = NULL;
 
                for ( sai=res; sai; sai=sai->ai_next ) {
                        if( sai->ai_addr == NULL ) {
@@ -436,13 +437,14 @@ static int slap_get_listener_addresses(
                                *sap = NULL;
                                break;
                        }
+
                        if (*sap != NULL) {
                                (*sap)->sa_family = sai->ai_family;
                                sap++;
+                               *sap = NULL;
                        }
                }
 
-               *sap = NULL;
                freeaddrinfo(res);
 #else
                struct in_addr in;