]> git.sur5r.net Git - openldap/commitdiff
Memory leaks: Values from ldap_dn2ufn and ldap_get_dn were not freed.
authorHallvard Furuseth <hallvard@openldap.org>
Wed, 11 Nov 1998 21:27:21 +0000 (21:27 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Wed, 11 Nov 1998 21:27:21 +0000 (21:27 +0000)
contrib/whois++/describe.c

index eb019fed701e9e30fa3406cc38158933c0b5e80e..94813d9370ec0a8b2947318f1b903e520be491a3 100644 (file)
@@ -182,11 +182,13 @@ according to the IAFA services template." );
                ldap_value_free( values );
        } else {
 #endif
-               value = strdup( ldap_dn2ufn( ldap_get_dn( ld, result ) ) );
+               value = ldap_dn2ufn( ptr = ldap_get_dn( ld, result ) );
+               free( ptr );
                if ( (ptr = index( value, ',' )) != NULL )
                        *ptr = '\0';
                printFormatted( lineLength, FALSE, stdout, "%-19s %s",
                        "Contact:", value );
+               free( value );
 #if defined(UOFA)
        }
 #endif