Diff for /libraries/liblber/decode.c between versions 1.30 and 1.32

version 1.30, 1999/05/29 03:16:31 version 1.32, 1999/06/02 22:37:46
Line 18 Line 18
 #include "portable.h"  #include "portable.h"
   
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  
   
 #include <ac/stdarg.h>  #include <ac/stdlib.h>
   
   #include <ac/stdarg.h>
 #include <ac/string.h>  #include <ac/string.h>
 #include <ac/socket.h>  #include <ac/socket.h>
   
Line 745  va_dcl Line 745  va_dcl
         return( rc );          return( rc );
 }  }
   
 void  
 ber_bvfree( struct berval *bv )  
 {  
         assert(bv != NULL);                     /* bv damn better point to something */  
   
         ber_int_options.lbo_valid = LBER_INITIALIZED;  
   
         if ( bv->bv_val != NULL )  
                 LBER_FREE( bv->bv_val );  
         LBER_FREE( (char *) bv );  
 }  
   
 void  
 ber_bvecfree( struct berval **bv )  
 {  
         int     i;  
   
         assert(bv != NULL);                     /* bv damn better point to something */  
   
         ber_int_options.lbo_valid = LBER_INITIALIZED;  
   
         for ( i = 0; bv[i] != NULL; i++ )  
                 ber_bvfree( bv[i] );  
         LBER_FREE( (char *) bv );  
 }  
   
 struct berval *  
 ber_bvdup(  
         LDAP_CONST struct berval *bv )  
 {  
         struct berval   *new;  
   
         assert( bv != NULL );  
   
         ber_int_options.lbo_valid = LBER_INITIALIZED;  
   
         if( bv == NULL ) {  
                 return NULL;  
         }  
   
         if ( (new = (struct berval *) LBER_MALLOC( sizeof(struct berval) ))  
             == NULL ) {  
                 return( NULL );  
         }  
   
         if ( bv->bv_val == NULL ) {  
                 new->bv_val = NULL;  
                 new->bv_len = 0;  
                 return ( new );  
         }  
   
         if ( (new->bv_val = (char *) LBER_MALLOC( bv->bv_len + 1 )) == NULL ) {  
                 LBER_FREE( new );  
                 return( NULL );  
         }  
   
         SAFEMEMCPY( new->bv_val, bv->bv_val, (size_t) bv->bv_len );  
         new->bv_val[bv->bv_len] = '\0';  
         new->bv_len = bv->bv_len;  
   
         return( new );  
 }  
   
   
 #ifdef STR_TRANSLATION  #ifdef STR_TRANSLATION
 void  void

Removed from v.1.30  
changed lines
  Added in v.1.32


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org