Ignore:
Timestamp:
Aug 7, 2014, 8:25:37 PM (11 years ago)
Author:
dmik
Message:

openssl: Merge version 1.0.0n from vendor to trunk.

Location:
openssl/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • openssl/trunk

  • TabularUnified openssl/trunk/crypto/bio/bio_lib.c

    r150 r808  
    111111int BIO_free(BIO *a)
    112112        {
    113         int ret=0,i;
     113        int i;
    114114
    115115        if (a == NULL) return(0);
     
    133133        CRYPTO_free_ex_data(CRYPTO_EX_INDEX_BIO, a, &a->ex_data);
    134134
    135         if ((a->method == NULL) || (a->method->destroy == NULL)) return(1);
    136         ret=a->method->destroy(a);
     135        if ((a->method != NULL) && (a->method->destroy != NULL))
     136                a->method->destroy(a);
    137137        OPENSSL_free(a);
    138138        return(1);
     
    522522BIO *BIO_dup_chain(BIO *in)
    523523        {
    524         BIO *ret=NULL,*eoc=NULL,*bio,*new;
     524        BIO *ret=NULL,*eoc=NULL,*bio,*new_bio;
    525525
    526526        for (bio=in; bio != NULL; bio=bio->next_bio)
    527527                {
    528                 if ((new=BIO_new(bio->method)) == NULL) goto err;
    529                 new->callback=bio->callback;
    530                 new->cb_arg=bio->cb_arg;
    531                 new->init=bio->init;
    532                 new->shutdown=bio->shutdown;
    533                 new->flags=bio->flags;
     528                if ((new_bio=BIO_new(bio->method)) == NULL) goto err;
     529                new_bio->callback=bio->callback;
     530                new_bio->cb_arg=bio->cb_arg;
     531                new_bio->init=bio->init;
     532                new_bio->shutdown=bio->shutdown;
     533                new_bio->flags=bio->flags;
    534534
    535535                /* This will let SSL_s_sock() work with stdin/stdout */
    536                 new->num=bio->num;
    537 
    538                 if (!BIO_dup_state(bio,(char *)new))
     536                new_bio->num=bio->num;
     537
     538                if (!BIO_dup_state(bio,(char *)new_bio))
    539539                        {
    540                         BIO_free(new);
     540                        BIO_free(new_bio);
    541541                        goto err;
    542542                        }
    543543
    544544                /* copy app data */
    545                 if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new->ex_data,
     545                if (!CRYPTO_dup_ex_data(CRYPTO_EX_INDEX_BIO, &new_bio->ex_data,
    546546                                        &bio->ex_data))
    547547                        goto err;
     
    549549                if (ret == NULL)
    550550                        {
    551                         eoc=new;
     551                        eoc=new_bio;
    552552                        ret=eoc;
    553553                        }
    554554                else
    555555                        {
    556                         BIO_push(eoc,new);
    557                         eoc=new;
     556                        BIO_push(eoc,new_bio);
     557                        eoc=new_bio;
    558558                        }
    559559                }
Note: See TracChangeset for help on using the changeset viewer.