summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/lhash/lhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/lhash/lhash.c')
-rw-r--r--src/lib/libcrypto/lhash/lhash.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c
index 7eb92a18bc..7da14620a4 100644
--- a/src/lib/libcrypto/lhash/lhash.c
+++ b/src/lib/libcrypto/lhash/lhash.c
@@ -116,9 +116,9 @@ LHASH *lh_new(unsigned long (*h)(), int (*c)())
116 LHASH *ret; 116 LHASH *ret;
117 int i; 117 int i;
118 118
119 if ((ret=(LHASH *)Malloc(sizeof(LHASH))) == NULL) 119 if ((ret=(LHASH *)OPENSSL_malloc(sizeof(LHASH))) == NULL)
120 goto err0; 120 goto err0;
121 if ((ret->b=(LHASH_NODE **)Malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL) 121 if ((ret->b=(LHASH_NODE **)OPENSSL_malloc(sizeof(LHASH_NODE *)*MIN_NODES)) == NULL)
122 goto err1; 122 goto err1;
123 for (i=0; i<MIN_NODES; i++) 123 for (i=0; i<MIN_NODES; i++)
124 ret->b[i]=NULL; 124 ret->b[i]=NULL;
@@ -149,7 +149,7 @@ LHASH *lh_new(unsigned long (*h)(), int (*c)())
149 ret->error=0; 149 ret->error=0;
150 return(ret); 150 return(ret);
151err1: 151err1:
152 Free(ret); 152 OPENSSL_free(ret);
153err0: 153err0:
154 return(NULL); 154 return(NULL);
155 } 155 }
@@ -168,12 +168,12 @@ void lh_free(LHASH *lh)
168 while (n != NULL) 168 while (n != NULL)
169 { 169 {
170 nn=n->next; 170 nn=n->next;
171 Free(n); 171 OPENSSL_free(n);
172 n=nn; 172 n=nn;
173 } 173 }
174 } 174 }
175 Free(lh->b); 175 OPENSSL_free(lh->b);
176 Free(lh); 176 OPENSSL_free(lh);
177 } 177 }
178 178
179void *lh_insert(LHASH *lh, void *data) 179void *lh_insert(LHASH *lh, void *data)
@@ -190,7 +190,7 @@ void *lh_insert(LHASH *lh, void *data)
190 190
191 if (*rn == NULL) 191 if (*rn == NULL)
192 { 192 {
193 if ((nn=(LHASH_NODE *)Malloc(sizeof(LHASH_NODE))) == NULL) 193 if ((nn=(LHASH_NODE *)OPENSSL_malloc(sizeof(LHASH_NODE))) == NULL)
194 { 194 {
195 lh->error++; 195 lh->error++;
196 return(NULL); 196 return(NULL);
@@ -233,7 +233,7 @@ void *lh_delete(LHASH *lh, void *data)
233 nn= *rn; 233 nn= *rn;
234 *rn=nn->next; 234 *rn=nn->next;
235 ret=nn->data; 235 ret=nn->data;
236 Free(nn); 236 OPENSSL_free(nn);
237 lh->num_delete++; 237 lh->num_delete++;
238 } 238 }
239 239
@@ -329,7 +329,7 @@ static void expand(LHASH *lh)
329 if ((lh->p) >= lh->pmax) 329 if ((lh->p) >= lh->pmax)
330 { 330 {
331 j=(int)lh->num_alloc_nodes*2; 331 j=(int)lh->num_alloc_nodes*2;
332 n=(LHASH_NODE **)Realloc(lh->b, 332 n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
333 (unsigned int)sizeof(LHASH_NODE *)*j); 333 (unsigned int)sizeof(LHASH_NODE *)*j);
334 if (n == NULL) 334 if (n == NULL)
335 { 335 {
@@ -357,7 +357,7 @@ static void contract(LHASH *lh)
357 lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */ 357 lh->b[lh->p+lh->pmax-1]=NULL; /* 24/07-92 - eay - weird but :-( */
358 if (lh->p == 0) 358 if (lh->p == 0)
359 { 359 {
360 n=(LHASH_NODE **)Realloc(lh->b, 360 n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
361 (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax)); 361 (unsigned int)(sizeof(LHASH_NODE *)*lh->pmax));
362 if (n == NULL) 362 if (n == NULL)
363 { 363 {