]> git.sur5r.net Git - openldap/commitdiff
Fix crasher in ldap_domain2dn()
authorLuke Howard <lukeh@openldap.org>
Thu, 10 Oct 2002 08:59:19 +0000 (08:59 +0000)
committerLuke Howard <lukeh@openldap.org>
Thu, 10 Oct 2002 08:59:19 +0000 (08:59 +0000)
libraries/libldap/dnssrv.c

index ef5eb89d3b8f58806d0cac45cb66430b2939e97d..69a7ec5bb39f4a3404b85027f4a4df7c504ab5c8 100644 (file)
@@ -141,7 +141,8 @@ int ldap_domain2dn(
                size_t len = strlen(s);
 
                dntmp = (char *) LDAP_REALLOC(dn, loc + sizeof(",dc=") + len );
-               if (dn == NULL) {
+               if (dntmp == NULL) {
+                   if (dn != NULL)
                        LDAP_FREE(dn);
                    LDAP_FREE(domain);
                    return LDAP_NO_MEMORY;