summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf/conf_def.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/conf/conf_def.c')
-rw-r--r--src/lib/libcrypto/conf/conf_def.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index 15e5613e36..32d47458a0 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -129,11 +129,11 @@ static CONF *def_create(CONF_METHOD *meth)
129 { 129 {
130 CONF *ret; 130 CONF *ret;
131 131
132 ret = OPENSSL_malloc(sizeof(CONF) + sizeof(unsigned short *)); 132 ret = malloc(sizeof(CONF) + sizeof(unsigned short *));
133 if (ret) 133 if (ret)
134 if (meth->init(ret) == 0) 134 if (meth->init(ret) == 0)
135 { 135 {
136 OPENSSL_free(ret); 136 free(ret);
137 ret = NULL; 137 ret = NULL;
138 } 138 }
139 return ret; 139 return ret;
@@ -167,7 +167,7 @@ static int def_destroy(CONF *conf)
167 { 167 {
168 if (def_destroy_data(conf)) 168 if (def_destroy_data(conf))
169 { 169 {
170 OPENSSL_free(conf); 170 free(conf);
171 return 1; 171 return 1;
172 } 172 }
173 return 0; 173 return 0;
@@ -228,7 +228,7 @@ static int def_load_bio(CONF *conf, BIO *in, long *line)
228 goto err; 228 goto err;
229 } 229 }
230 230
231 section=(char *)OPENSSL_malloc(10); 231 section=(char *)malloc(10);
232 if (section == NULL) 232 if (section == NULL)
233 { 233 {
234 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE); 234 CONFerr(CONF_F_DEF_LOAD_BIO,ERR_R_MALLOC_FAILURE);
@@ -373,14 +373,14 @@ again:
373 p++; 373 p++;
374 *p='\0'; 374 *p='\0';
375 375
376 if (!(v=(CONF_VALUE *)OPENSSL_malloc(sizeof(CONF_VALUE)))) 376 if (!(v=(CONF_VALUE *)malloc(sizeof(CONF_VALUE))))
377 { 377 {
378 CONFerr(CONF_F_DEF_LOAD_BIO, 378 CONFerr(CONF_F_DEF_LOAD_BIO,
379 ERR_R_MALLOC_FAILURE); 379 ERR_R_MALLOC_FAILURE);
380 goto err; 380 goto err;
381 } 381 }
382 if (psection == NULL) psection=section; 382 if (psection == NULL) psection=section;
383 v->name=(char *)OPENSSL_malloc(strlen(pname)+1); 383 v->name=(char *)malloc(strlen(pname)+1);
384 v->value=NULL; 384 v->value=NULL;
385 if (v->name == NULL) 385 if (v->name == NULL)
386 { 386 {
@@ -424,20 +424,20 @@ again:
424 if (vv != NULL) 424 if (vv != NULL)
425 { 425 {
426 sk_CONF_VALUE_delete_ptr(ts,vv); 426 sk_CONF_VALUE_delete_ptr(ts,vv);
427 OPENSSL_free(vv->name); 427 free(vv->name);
428 OPENSSL_free(vv->value); 428 free(vv->value);
429 OPENSSL_free(vv); 429 free(vv);
430 } 430 }
431#endif 431#endif
432 v=NULL; 432 v=NULL;
433 } 433 }
434 } 434 }
435 if (buff != NULL) BUF_MEM_free(buff); 435 if (buff != NULL) BUF_MEM_free(buff);
436 if (section != NULL) OPENSSL_free(section); 436 if (section != NULL) free(section);
437 return(1); 437 return(1);
438err: 438err:
439 if (buff != NULL) BUF_MEM_free(buff); 439 if (buff != NULL) BUF_MEM_free(buff);
440 if (section != NULL) OPENSSL_free(section); 440 if (section != NULL) free(section);
441 if (line != NULL) *line=eline; 441 if (line != NULL) *line=eline;
442 (void) snprintf(btmp,sizeof btmp,"%ld",eline); 442 (void) snprintf(btmp,sizeof btmp,"%ld",eline);
443 ERR_add_error_data(2,"line ",btmp); 443 ERR_add_error_data(2,"line ",btmp);
@@ -448,9 +448,9 @@ err:
448 } 448 }
449 if (v != NULL) 449 if (v != NULL)
450 { 450 {
451 if (v->name != NULL) OPENSSL_free(v->name); 451 if (v->name != NULL) free(v->name);
452 if (v->value != NULL) OPENSSL_free(v->value); 452 if (v->value != NULL) free(v->value);
453 if (v != NULL) OPENSSL_free(v); 453 if (v != NULL) free(v);
454 } 454 }
455 return(0); 455 return(0);
456 } 456 }
@@ -637,9 +637,9 @@ static int str_copy(CONF *conf, char *section, char **pto, char *from)
637 buf->data[to++]= *(from++); 637 buf->data[to++]= *(from++);
638 } 638 }
639 buf->data[to]='\0'; 639 buf->data[to]='\0';
640 if (*pto != NULL) OPENSSL_free(*pto); 640 if (*pto != NULL) free(*pto);
641 *pto=buf->data; 641 *pto=buf->data;
642 OPENSSL_free(buf); 642 free(buf);
643 return(1); 643 return(1);
644err: 644err:
645 if (buf != NULL) BUF_MEM_free(buf); 645 if (buf != NULL) BUF_MEM_free(buf);