]> git.sur5r.net Git - openldap/commitdiff
Fix previous commit
authorLuke Howard <lukeh@openldap.org>
Fri, 2 Jan 2004 06:34:50 +0000 (06:34 +0000)
committerLuke Howard <lukeh@openldap.org>
Fri, 2 Jan 2004 06:34:50 +0000 (06:34 +0000)
servers/slapd/slapi/slapi_utils.c

index de62de247f1283b4a002374b83f182020d8f0f45..9a1fc49b32e0b3459d411ff5bd07777a18827f61 100644 (file)
@@ -309,7 +309,12 @@ slapi_entry_attr_get_charptr( const Slapi_Entry *e, const char *type )
        }
 
        if ( attr->a_vals != NULL && attr->a_vals[0].bv_len != 0 ) {
-               return (char *)slapi_value_get_string( attr->a_vals );
+               const char *p;
+
+               p = slapi_value_get_string( &attr->a_vals[0] );
+               if ( p != NULL ) {
+                       return slapi_ch_strdup( (char *)p );
+               }
        }
 
        return NULL;