summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_print.c')
-rw-r--r--src/lib/libcrypto/bn/bn_print.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/bn/bn_print.c b/src/lib/libcrypto/bn/bn_print.c
index 782a96e7e0..532e66bcc3 100644
--- a/src/lib/libcrypto/bn/bn_print.c
+++ b/src/lib/libcrypto/bn/bn_print.c
@@ -64,14 +64,14 @@
64 64
65static const char *Hex="0123456789ABCDEF"; 65static const char *Hex="0123456789ABCDEF";
66 66
67/* Must 'Free' the returned data */ 67/* Must 'OPENSSL_free' the returned data */
68char *BN_bn2hex(const BIGNUM *a) 68char *BN_bn2hex(const BIGNUM *a)
69 { 69 {
70 int i,j,v,z=0; 70 int i,j,v,z=0;
71 char *buf; 71 char *buf;
72 char *p; 72 char *p;
73 73
74 buf=(char *)Malloc(a->top*BN_BYTES*2+2); 74 buf=(char *)OPENSSL_malloc(a->top*BN_BYTES*2+2);
75 if (buf == NULL) 75 if (buf == NULL)
76 { 76 {
77 BNerr(BN_F_BN_BN2HEX,ERR_R_MALLOC_FAILURE); 77 BNerr(BN_F_BN_BN2HEX,ERR_R_MALLOC_FAILURE);
@@ -99,7 +99,7 @@ err:
99 return(buf); 99 return(buf);
100 } 100 }
101 101
102/* Must 'Free' the returned data */ 102/* Must 'OPENSSL_free' the returned data */
103char *BN_bn2dec(const BIGNUM *a) 103char *BN_bn2dec(const BIGNUM *a)
104 { 104 {
105 int i=0,num; 105 int i=0,num;
@@ -110,8 +110,8 @@ char *BN_bn2dec(const BIGNUM *a)
110 110
111 i=BN_num_bits(a)*3; 111 i=BN_num_bits(a)*3;
112 num=(i/10+i/1000+3)+1; 112 num=(i/10+i/1000+3)+1;
113 bn_data=(BN_ULONG *)Malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG)); 113 bn_data=(BN_ULONG *)OPENSSL_malloc((num/BN_DEC_NUM+1)*sizeof(BN_ULONG));
114 buf=(char *)Malloc(num+3); 114 buf=(char *)OPENSSL_malloc(num+3);
115 if ((buf == NULL) || (bn_data == NULL)) 115 if ((buf == NULL) || (bn_data == NULL))
116 { 116 {
117 BNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE); 117 BNerr(BN_F_BN_BN2DEC,ERR_R_MALLOC_FAILURE);
@@ -149,7 +149,7 @@ char *BN_bn2dec(const BIGNUM *a)
149 } 149 }
150 } 150 }
151err: 151err:
152 if (bn_data != NULL) Free(bn_data); 152 if (bn_data != NULL) OPENSSL_free(bn_data);
153 if (t != NULL) BN_free(t); 153 if (t != NULL) BN_free(t);
154 return(buf); 154 return(buf);
155 } 155 }