summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_set.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_set.c')
-rw-r--r--src/lib/libcrypto/asn1/a_set.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/a_set.c b/src/lib/libcrypto/asn1/a_set.c
index c2481e7597..caf5a1419c 100644
--- a/src/lib/libcrypto/asn1/a_set.c
+++ b/src/lib/libcrypto/asn1/a_set.c
@@ -116,7 +116,7 @@ int i2d_ASN1_SET(STACK *a, unsigned char **pp, int (*func)(), int ex_tag,
116 } 116 }
117 117
118 pStart = p; /* Catch the beg of Setblobs*/ 118 pStart = p; /* Catch the beg of Setblobs*/
119 rgSetBlob = (MYBLOB *)Malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array 119 rgSetBlob = (MYBLOB *)OPENSSL_malloc( sk_num(a) * sizeof(MYBLOB)); /* In this array
120we will store the SET blobs */ 120we will store the SET blobs */
121 121
122 for (i=0; i<sk_num(a); i++) 122 for (i=0; i<sk_num(a); i++)
@@ -133,7 +133,7 @@ SetBlob
133 /* Now we have to sort the blobs. I am using a simple algo. 133 /* Now we have to sort the blobs. I am using a simple algo.
134 *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/ 134 *Sort ptrs *Copy to temp-mem *Copy from temp-mem to user-mem*/
135 qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp); 135 qsort( rgSetBlob, sk_num(a), sizeof(MYBLOB), SetBlobCmp);
136 pTempMem = Malloc(totSize); 136 pTempMem = OPENSSL_malloc(totSize);
137 137
138/* Copy to temp mem */ 138/* Copy to temp mem */
139 p = pTempMem; 139 p = pTempMem;
@@ -145,20 +145,20 @@ SetBlob
145 145
146/* Copy back to user mem*/ 146/* Copy back to user mem*/
147 memcpy(pStart, pTempMem, totSize); 147 memcpy(pStart, pTempMem, totSize);
148 Free(pTempMem); 148 OPENSSL_free(pTempMem);
149 Free(rgSetBlob); 149 OPENSSL_free(rgSetBlob);
150 150
151 return(r); 151 return(r);
152 } 152 }
153 153
154STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length, 154STACK *d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
155 char *(*func)(), void (*free_func)(), int ex_tag, int ex_class) 155 char *(*func)(), void (*free_func)(void *), int ex_tag, int ex_class)
156 { 156 {
157 ASN1_CTX c; 157 ASN1_CTX c;
158 STACK *ret=NULL; 158 STACK *ret=NULL;
159 159
160 if ((a == NULL) || ((*a) == NULL)) 160 if ((a == NULL) || ((*a) == NULL))
161 { if ((ret=sk_new(NULL)) == NULL) goto err; } 161 { if ((ret=sk_new_null()) == NULL) goto err; }
162 else 162 else
163 ret=(*a); 163 ret=(*a);
164 164