]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/ad.c
make sure NULL pointers are not dereferenced
[openldap] / servers / slapd / ad.c
index 7183d5e59fb6f3d5efac1b6e7987d470150f4092..4ac9b6a8c042768c66d4632825fa8605ba45d021 100644 (file)
@@ -1177,11 +1177,13 @@ ad_define_option( const char *name, const char *fname, int lineno )
        return 0;
 }
 
-void ad_unparse_options( BerVarray *res ){
+void
+ad_unparse_options( BerVarray *res )
+{
        int i;
-    for ( i=0; i < option_count; i++ ) {
-       ber_bvarray_add( res, ber_bvdup( &(options[i].name) ));
-    }
+       for ( i = 0; i < option_count; i++ ) {
+               value_add_one( res, &options[i].name );
+       }
 }
 
 /* Find the definition of the option name or prefix matching the arguments */