From 31026020026dd5f41978b2a5b9e3169f6d74d9f3 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Fri, 2 Jan 2004 06:34:50 +0000 Subject: [PATCH] Fix previous commit --- servers/slapd/slapi/slapi_utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index de62de247f..9a1fc49b32 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -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; -- 2.39.5