Lines Matching defs:bv
279 ber_get_stringal( BerElement *ber, struct berval **bv )
283 if ( (*bv = (struct berval *) malloc( sizeof(struct berval) )) == NULL )
289 if ( ((*bv)->bv_val = (char *) malloc( (size_t)len + 1 )) == NULL )
292 if ( ber_read( ber, (*bv)->bv_val, len ) != len )
294 ((*bv)->bv_val)[len] = '\0';
295 (*bv)->bv_len = len;
301 if ( (*(ber->ber_decode_translate_proc))( &((*bv)->bv_val),
303 free( (*bv)->bv_val );
306 (*bv)->bv_len = len - 1;
406 struct berval ***bv, **bvp, *bval;
508 bv = va_arg( ap, struct berval *** );
509 *bv = NULL;
514 if ( *bv == NULL ) {
515 *bv = (struct berval **) malloc(
518 *bv = (struct berval **) realloc( *bv,
521 rc = ber_get_stringal( ber, &((*bv)[j]) );
525 (*bv)[j] = NULL;
559 ber_bvfree( struct berval *bv )
561 if ( bv->bv_val != NULL )
562 free( bv->bv_val );
563 free( (char *) bv );
567 ber_bvecfree( struct berval **bv )
571 for ( i = 0; bv[i] != NULL; i++ )
572 ber_bvfree( bv[i] );
573 free( (char *) bv );
577 ber_bvdup( struct berval *bv )
585 if ( (new->bv_val = (char *) malloc( bv->bv_len + 1 )) == NULL ) {
589 SAFEMEMCPY( new->bv_val, bv->bv_val, (size_t) bv->bv_len );
590 new->bv_val[bv->bv_len] = '\0';
591 new->bv_len = bv->bv_len;
609 struct berval * bv;
617 if ((bv = (struct berval *)malloc(sizeof(struct berval))) == NULL)
619 if ((bv->bv_val = (char *) malloc(len + 1)) == NULL) {
620 free(bv);
624 SAFEMEMCPY(bv->bv_val, ber->ber_buf, (size_t)len);
625 bv->bv_val[len] = '\0';
626 bv->bv_len = len;
628 *bvPtr = bv;