diff options
Diffstat (limited to 'lib/libcrypto/asn1/a_dup.c')
-rw-r--r-- | lib/libcrypto/asn1/a_dup.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/libcrypto/asn1/a_dup.c b/lib/libcrypto/asn1/a_dup.c index e825b9c2d46..4482a893373 100644 --- a/lib/libcrypto/asn1/a_dup.c +++ b/lib/libcrypto/asn1/a_dup.c @@ -63,7 +63,7 @@ #ifndef NO_OLD_ASN1 void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) - { +{ unsigned char *b,*p; const unsigned char *p2; int i; @@ -74,14 +74,16 @@ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) i=i2d(x,NULL); b=malloc(i+10); if (b == NULL) - { ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } + { + ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); + } p= b; i=i2d(x,&p); p2= b; ret=d2i(NULL,&p2,i); free(b); return(ret); - } +} #endif @@ -91,7 +93,7 @@ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) */ void *ASN1_item_dup(const ASN1_ITEM *it, void *x) - { +{ unsigned char *b = NULL; const unsigned char *p; long i; @@ -101,9 +103,11 @@ void *ASN1_item_dup(const ASN1_ITEM *it, void *x) i=ASN1_item_i2d(x,&b,it); if (b == NULL) - { ASN1err(ASN1_F_ASN1_ITEM_DUP,ERR_R_MALLOC_FAILURE); return(NULL); } + { + ASN1err(ASN1_F_ASN1_ITEM_DUP,ERR_R_MALLOC_FAILURE); return(NULL); + } p= b; ret=ASN1_item_d2i(NULL,&p,i, it); free(b); return(ret); - } +} |