summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/txt_db/txt_db.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/txt_db/txt_db.c')
-rw-r--r--src/lib/libcrypto/txt_db/txt_db.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/txt_db/txt_db.c b/src/lib/libcrypto/txt_db/txt_db.c
index 33acc81f3f..3b04fe280c 100644
--- a/src/lib/libcrypto/txt_db/txt_db.c
+++ b/src/lib/libcrypto/txt_db/txt_db.c
@@ -83,16 +83,16 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
83 if ((buf=BUF_MEM_new()) == NULL) goto err; 83 if ((buf=BUF_MEM_new()) == NULL) goto err;
84 if (!BUF_MEM_grow(buf,size)) goto err; 84 if (!BUF_MEM_grow(buf,size)) goto err;
85 85
86 if ((ret=(TXT_DB *)Malloc(sizeof(TXT_DB))) == NULL) 86 if ((ret=(TXT_DB *)OPENSSL_malloc(sizeof(TXT_DB))) == NULL)
87 goto err; 87 goto err;
88 ret->num_fields=num; 88 ret->num_fields=num;
89 ret->index=NULL; 89 ret->index=NULL;
90 ret->qual=NULL; 90 ret->qual=NULL;
91 if ((ret->data=sk_new_null()) == NULL) 91 if ((ret->data=sk_new_null()) == NULL)
92 goto err; 92 goto err;
93 if ((ret->index=(LHASH **)Malloc(sizeof(LHASH *)*num)) == NULL) 93 if ((ret->index=(LHASH **)OPENSSL_malloc(sizeof(LHASH *)*num)) == NULL)
94 goto err; 94 goto err;
95 if ((ret->qual=(int (**)())Malloc(sizeof(int (**)())*num)) == NULL) 95 if ((ret->qual=(int (**)())OPENSSL_malloc(sizeof(int (**)())*num)) == NULL)
96 goto err; 96 goto err;
97 for (i=0; i<num; i++) 97 for (i=0; i<num; i++)
98 { 98 {
@@ -122,7 +122,7 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
122 else 122 else
123 { 123 {
124 buf->data[offset-1]='\0'; /* blat the '\n' */ 124 buf->data[offset-1]='\0'; /* blat the '\n' */
125 p=(char *)Malloc(add+offset); 125 p=(char *)OPENSSL_malloc(add+offset);
126 offset=0; 126 offset=0;
127 } 127 }
128 pp=(char **)p; 128 pp=(char **)p;
@@ -177,12 +177,12 @@ err:
177 if (er) 177 if (er)
178 { 178 {
179#if !defined(NO_STDIO) && !defined(WIN16) 179#if !defined(NO_STDIO) && !defined(WIN16)
180 if (er == 1) fprintf(stderr,"Malloc failure\n"); 180 if (er == 1) fprintf(stderr,"OPENSSL_malloc failure\n");
181#endif 181#endif
182 if (ret->data != NULL) sk_free(ret->data); 182 if (ret->data != NULL) sk_free(ret->data);
183 if (ret->index != NULL) Free(ret->index); 183 if (ret->index != NULL) OPENSSL_free(ret->index);
184 if (ret->qual != NULL) Free(ret->qual); 184 if (ret->qual != NULL) OPENSSL_free(ret->qual);
185 if (ret != NULL) Free(ret); 185 if (ret != NULL) OPENSSL_free(ret);
186 return(NULL); 186 return(NULL);
187 } 187 }
188 else 188 else
@@ -349,10 +349,10 @@ void TXT_DB_free(TXT_DB *db)
349 { 349 {
350 for (i=db->num_fields-1; i>=0; i--) 350 for (i=db->num_fields-1; i>=0; i--)
351 if (db->index[i] != NULL) lh_free(db->index[i]); 351 if (db->index[i] != NULL) lh_free(db->index[i]);
352 Free(db->index); 352 OPENSSL_free(db->index);
353 } 353 }
354 if (db->qual != NULL) 354 if (db->qual != NULL)
355 Free(db->qual); 355 OPENSSL_free(db->qual);
356 if (db->data != NULL) 356 if (db->data != NULL)
357 { 357 {
358 for (i=sk_num(db->data)-1; i>=0; i--) 358 for (i=sk_num(db->data)-1; i>=0; i--)
@@ -364,7 +364,7 @@ void TXT_DB_free(TXT_DB *db)
364 if (max == NULL) /* new row */ 364 if (max == NULL) /* new row */
365 { 365 {
366 for (n=0; n<db->num_fields; n++) 366 for (n=0; n<db->num_fields; n++)
367 if (p[n] != NULL) Free(p[n]); 367 if (p[n] != NULL) OPENSSL_free(p[n]);
368 } 368 }
369 else 369 else
370 { 370 {
@@ -372,12 +372,12 @@ void TXT_DB_free(TXT_DB *db)
372 { 372 {
373 if (((p[n] < (char *)p) || (p[n] > max)) 373 if (((p[n] < (char *)p) || (p[n] > max))
374 && (p[n] != NULL)) 374 && (p[n] != NULL))
375 Free(p[n]); 375 OPENSSL_free(p[n]);
376 } 376 }
377 } 377 }
378 Free(sk_value(db->data,i)); 378 OPENSSL_free(sk_value(db->data,i));
379 } 379 }
380 sk_free(db->data); 380 sk_free(db->data);
381 } 381 }
382 Free(db); 382 OPENSSL_free(db);
383 } 383 }