diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/a_dup.c')
-rw-r--r-- | src/lib/libcrypto/asn1/a_dup.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/libcrypto/asn1/a_dup.c b/src/lib/libcrypto/asn1/a_dup.c index 4482a89337..409bdcf2d1 100644 --- a/src/lib/libcrypto/asn1/a_dup.c +++ b/src/lib/libcrypto/asn1/a_dup.c | |||
@@ -69,13 +69,14 @@ void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) | |||
69 | int i; | 69 | int i; |
70 | char *ret; | 70 | char *ret; |
71 | 71 | ||
72 | if (x == NULL) return(NULL); | 72 | if (x == NULL) |
73 | return(NULL); | ||
73 | 74 | ||
74 | i=i2d(x,NULL); | 75 | i=i2d(x,NULL); |
75 | b=malloc(i+10); | 76 | b=malloc(i+10); |
76 | if (b == NULL) | 77 | if (b == NULL) { |
77 | { | 78 | ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); |
78 | ASN1err(ASN1_F_ASN1_DUP,ERR_R_MALLOC_FAILURE); return(NULL); | 79 | return(NULL); |
79 | } | 80 | } |
80 | p= b; | 81 | p= b; |
81 | i=i2d(x,&p); | 82 | i=i2d(x,&p); |
@@ -99,12 +100,13 @@ void *ASN1_item_dup(const ASN1_ITEM *it, void *x) | |||
99 | long i; | 100 | long i; |
100 | void *ret; | 101 | void *ret; |
101 | 102 | ||
102 | if (x == NULL) return(NULL); | 103 | if (x == NULL) |
104 | return(NULL); | ||
103 | 105 | ||
104 | i=ASN1_item_i2d(x,&b,it); | 106 | i=ASN1_item_i2d(x,&b,it); |
105 | if (b == NULL) | 107 | if (b == NULL) { |
106 | { | 108 | ASN1err(ASN1_F_ASN1_ITEM_DUP,ERR_R_MALLOC_FAILURE); |
107 | ASN1err(ASN1_F_ASN1_ITEM_DUP,ERR_R_MALLOC_FAILURE); return(NULL); | 109 | return(NULL); |
108 | } | 110 | } |
109 | p= b; | 111 | p= b; |
110 | ret=ASN1_item_d2i(NULL,&p,i, it); | 112 | ret=ASN1_item_d2i(NULL,&p,i, it); |