Diff for /libraries/liblber/decode.c between versions 1.71 and 1.72

version 1.71, 2002/01/03 01:53:41 version 1.72, 2002/01/03 02:11:14
Line 1 Line 1
 /* decode.c - ber input decoding routines */  /* decode.c - ber input decoding routines */
 /* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.70 2002/01/02 16:06:56 kurt Exp $ */  /* $OpenLDAP: pkg/ldap/libraries/liblber/decode.c,v 1.71 2002/01/03 01:53:41 hyc Exp $ */
 /*  /*
  * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.   * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file   * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
Line 296  typedef struct bgbvr { Line 296  typedef struct bgbvr {
 ber_tag_t  ber_tag_t
 ber_get_stringbvr( bgbvr *b, int n )  ber_get_stringbvr( bgbvr *b, int n )
 {  {
         struct berval bv;          struct berval bv, *bvp = NULL;
   
         if ( n )          if ( n )
                 b->tag = ber_next_element( b->ber, &b->len, b->last );                  b->tag = ber_next_element( b->ber, &b->len, b->last );
Line 327  ber_get_stringbvr( bgbvr *b, int n ) Line 327  ber_get_stringbvr( bgbvr *b, int n )
                 return 0;                  return 0;
         }          }
   
         if ( ber_get_stringbv( b->ber, &bv ) == LBER_DEFAULT )          if ( b->choice == BvVec )
                   bvp = LBER_MALLOC( sizeof( struct berval ));
   
           if ( ber_get_stringbv( b->ber, &bv ) == LBER_DEFAULT ) {
                   if ( bvp ) LBER_FREE( bvp );
                 return LBER_DEFAULT;                  return LBER_DEFAULT;
           }
   
         b->tag = ber_get_stringbvr( b, n+1 );          b->tag = ber_get_stringbvr( b, n+1 );
         if ( b->tag == 0 )          if ( b->tag == 0 )
Line 342  ber_get_stringbvr( bgbvr *b, int n ) Line 347  ber_get_stringbvr( bgbvr *b, int n )
                         (*b->res.ba)[n] = bv;                          (*b->res.ba)[n] = bv;
                         break;                          break;
                 case BvVec:                  case BvVec:
                         (*b->res.bv)[n] = ber_bvdup( &bv );                          (*b->res.bv)[n] = bvp;
                           *bvp = bv;
                         break;                          break;
                 }                  }
         } else {          } else {
                   if ( bvp ) LBER_FREE( bvp );
                 LBER_FREE( bv.bv_val );                  LBER_FREE( bv.bv_val );
         }          }
         return b->tag;          return b->tag;

Removed from v.1.71  
changed lines
  Added in v.1.72


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