summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
committerRichard Levitte <levitte@openssl.org>2000-06-01 22:19:21 +0000
commit26a3a48d65c7464b400ec1de439994d7f0d25fed (patch)
tree91abb7d351b174e58f60e5353b731b916eaf0c5c /apps
parentde42b6a7a82be33d2976ab605e74d7bc95b71447 (diff)
There have been a number of complaints from a number of sources that names
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
Diffstat (limited to 'apps')
-rw-r--r--apps/apps.c12
-rw-r--r--apps/asn1pars.c2
-rw-r--r--apps/ca.c50
-rw-r--r--apps/crl2p7.c4
-rw-r--r--apps/dgst.c4
-rw-r--r--apps/dh.c6
-rw-r--r--apps/dhparam.c6
-rw-r--r--apps/dsa.c4
-rw-r--r--apps/dsaparam.c4
-rw-r--r--apps/enc.c12
-rw-r--r--apps/gendsa.c2
-rw-r--r--apps/genrsa.c2
-rw-r--r--apps/openssl.c2
-rw-r--r--apps/passwd.c10
-rw-r--r--apps/pkcs12.c6
-rw-r--r--apps/pkcs8.c8
-rw-r--r--apps/req.c4
-rw-r--r--apps/rsa.c10
-rw-r--r--apps/s_client.c8
-rw-r--r--apps/s_server.c16
-rw-r--r--apps/s_socket.c6
-rw-r--r--apps/smime.c2
-rw-r--r--apps/speed.c8
-rw-r--r--apps/spkac.c4
-rw-r--r--apps/x509.c10
25 files changed, 101 insertions, 101 deletions
diff --git a/apps/apps.c b/apps/apps.c
index a87d23bf33..f063d83128 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -91,8 +91,8 @@ int args_from_file(char *file, int *argc, char **argv[])
*argv=NULL;
len=(unsigned int)stbuf.st_size;
- if (buf != NULL) Free(buf);
- buf=(char *)Malloc(len+1);
+ if (buf != NULL) OPENSSL_free(buf);
+ buf=(char *)OPENSSL_malloc(len+1);
if (buf == NULL) return(0);
len=fread(buf,1,len,fp);
@@ -102,8 +102,8 @@ int args_from_file(char *file, int *argc, char **argv[])
i=0;
for (p=buf; *p; p++)
if (*p == '\n') i++;
- if (arg != NULL) Free(arg);
- arg=(char **)Malloc(sizeof(char *)*(i*2));
+ if (arg != NULL) OPENSSL_free(arg);
+ arg=(char **)OPENSSL_malloc(sizeof(char *)*(i*2));
*argv=arg;
num=0;
@@ -266,7 +266,7 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
if (arg->count == 0)
{
arg->count=20;
- arg->data=(char **)Malloc(sizeof(char *)*arg->count);
+ arg->data=(char **)OPENSSL_malloc(sizeof(char *)*arg->count);
}
for (i=0; i<arg->count; i++)
arg->data[i]=NULL;
@@ -285,7 +285,7 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
if (num >= arg->count)
{
arg->count+=20;
- arg->data=(char **)Realloc(arg->data,
+ arg->data=(char **)OPENSSL_realloc(arg->data,
sizeof(char *)*arg->count);
if (argc == 0) return(0);
}
diff --git a/apps/asn1pars.c b/apps/asn1pars.c
index f104ebc1f0..2d64492ffd 100644
--- a/apps/asn1pars.c
+++ b/apps/asn1pars.c
@@ -108,7 +108,7 @@ int MAIN(int argc, char **argv)
argv++;
if ((osk=sk_new_null()) == NULL)
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto end;
}
while (argc >= 1)
diff --git a/apps/ca.c b/apps/ca.c
index 62747ec47c..69352654e2 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -808,7 +808,7 @@ bad:
{
if ((f=BN_bn2hex(serial)) == NULL) goto err;
BIO_printf(bio_err,"next serial number is %s\n",f);
- Free(f);
+ OPENSSL_free(f);
}
if ((attribs=CONF_get_section(conf,policy)) == NULL)
@@ -819,7 +819,7 @@ bad:
if ((cert_sk=sk_X509_new_null()) == NULL)
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
if (spkac_file != NULL)
@@ -836,7 +836,7 @@ bad:
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
if (outfile)
@@ -860,7 +860,7 @@ bad:
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
@@ -879,7 +879,7 @@ bad:
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
@@ -898,7 +898,7 @@ bad:
if (!BN_add_word(serial,1)) goto err;
if (!sk_X509_push(cert_sk,x))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
@@ -1580,7 +1580,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, const EVP_MD *dgst,
/* Ok, now we check the 'policy' stuff. */
if ((subject=X509_NAME_new()) == NULL)
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
@@ -1678,7 +1678,7 @@ again2:
{
if (push != NULL)
X509_NAME_ENTRY_free(push);
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
}
@@ -1700,7 +1700,7 @@ again2:
row[DB_serial]=BN_bn2hex(serial);
if ((row[DB_name] == NULL) || (row[DB_serial] == NULL))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
@@ -1841,32 +1841,32 @@ again2:
goto err;
/* We now just add it to the database */
- row[DB_type]=(char *)Malloc(2);
+ row[DB_type]=(char *)OPENSSL_malloc(2);
tm=X509_get_notAfter(ret);
- row[DB_exp_date]=(char *)Malloc(tm->length+1);
+ row[DB_exp_date]=(char *)OPENSSL_malloc(tm->length+1);
memcpy(row[DB_exp_date],tm->data,tm->length);
row[DB_exp_date][tm->length]='\0';
row[DB_rev_date]=NULL;
/* row[DB_serial] done already */
- row[DB_file]=(char *)Malloc(8);
+ row[DB_file]=(char *)OPENSSL_malloc(8);
/* row[DB_name] done already */
if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) ||
(row[DB_file] == NULL))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
strcpy(row[DB_file],"unknown");
row[DB_type][0]='V';
row[DB_type][1]='\0';
- if ((irow=(char **)Malloc(sizeof(char *)*(DB_NUMBER+1))) == NULL)
+ if ((irow=(char **)OPENSSL_malloc(sizeof(char *)*(DB_NUMBER+1))) == NULL)
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
@@ -1886,7 +1886,7 @@ again2:
ok=1;
err:
for (i=0; i<DB_NUMBER; i++)
- if (row[i] != NULL) Free(row[i]);
+ if (row[i] != NULL) OPENSSL_free(row[i]);
if (CAname != NULL)
X509_NAME_free(CAname);
@@ -2137,7 +2137,7 @@ static int do_revoke(X509 *x509, TXT_DB *db)
BN_free(bn);
if ((row[DB_name] == NULL) || (row[DB_serial] == NULL))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
/* We have to lookup by serial number because name lookup
@@ -2149,33 +2149,33 @@ static int do_revoke(X509 *x509, TXT_DB *db)
BIO_printf(bio_err,"Adding Entry to DB for %s\n", row[DB_name]);
/* We now just add it to the database */
- row[DB_type]=(char *)Malloc(2);
+ row[DB_type]=(char *)OPENSSL_malloc(2);
tm=X509_get_notAfter(x509);
- row[DB_exp_date]=(char *)Malloc(tm->length+1);
+ row[DB_exp_date]=(char *)OPENSSL_malloc(tm->length+1);
memcpy(row[DB_exp_date],tm->data,tm->length);
row[DB_exp_date][tm->length]='\0';
row[DB_rev_date]=NULL;
/* row[DB_serial] done already */
- row[DB_file]=(char *)Malloc(8);
+ row[DB_file]=(char *)OPENSSL_malloc(8);
/* row[DB_name] done already */
if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) ||
(row[DB_file] == NULL))
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
strcpy(row[DB_file],"unknown");
row[DB_type][0]='V';
row[DB_type][1]='\0';
- if ((irow=(char **)Malloc(sizeof(char *)*(DB_NUMBER+1))) == NULL)
+ if ((irow=(char **)OPENSSL_malloc(sizeof(char *)*(DB_NUMBER+1))) == NULL)
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto err;
}
@@ -2218,7 +2218,7 @@ static int do_revoke(X509 *x509, TXT_DB *db)
revtm=X509_gmtime_adj(revtm,0);
rrow[DB_type][0]='R';
rrow[DB_type][1]='\0';
- rrow[DB_rev_date]=(char *)Malloc(revtm->length+1);
+ rrow[DB_rev_date]=(char *)OPENSSL_malloc(revtm->length+1);
memcpy(rrow[DB_rev_date],revtm->data,revtm->length);
rrow[DB_rev_date][revtm->length]='\0';
ASN1_UTCTIME_free(revtm);
@@ -2228,7 +2228,7 @@ err:
for (i=0; i<DB_NUMBER; i++)
{
if (row[i] != NULL)
- Free(row[i]);
+ OPENSSL_free(row[i]);
}
return(ok);
}
diff --git a/apps/crl2p7.c b/apps/crl2p7.c
index 4056591676..ebf5fe90ec 100644
--- a/apps/crl2p7.c
+++ b/apps/crl2p7.c
@@ -220,7 +220,7 @@ bad:
if (crl != NULL)
{
sk_X509_CRL_push(crl_stack,crl);
- crl=NULL; /* now part of p7 for Freeing */
+ crl=NULL; /* now part of p7 for OPENSSL_freeing */
}
if ((cert_stack=sk_X509_new(NULL)) == NULL) goto end;
@@ -327,7 +327,7 @@ static int add_certs_from_file(STACK_OF(X509) *stack, char *certfile)
ret=count;
end:
- /* never need to Free x */
+ /* never need to OPENSSL_free x */
if (in != NULL) BIO_free(in);
if (sk != NULL) sk_X509_INFO_free(sk);
return(ret);
diff --git a/apps/dgst.c b/apps/dgst.c
index 1b56d6ef44..3db28d25ca 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -92,7 +92,7 @@ int MAIN(int argc, char **argv)
apps_startup();
- if ((buf=(unsigned char *)Malloc(BUFSIZE)) == NULL)
+ if ((buf=(unsigned char *)OPENSSL_malloc(BUFSIZE)) == NULL)
{
BIO_printf(bio_err,"out of memory\n");
goto end;
@@ -192,7 +192,7 @@ end:
if (buf != NULL)
{
memset(buf,0,BUFSIZE);
- Free(buf);
+ OPENSSL_free(buf);
}
if (in != NULL) BIO_free(in);
if (bmd != NULL) BIO_free(bmd);
diff --git a/apps/dh.c b/apps/dh.c
index 674963f81a..ee71d95f0c 100644
--- a/apps/dh.c
+++ b/apps/dh.c
@@ -251,10 +251,10 @@ bad:
len=BN_num_bytes(dh->p);
bits=BN_num_bits(dh->p);
- data=(unsigned char *)Malloc(len);
+ data=(unsigned char *)OPENSSL_malloc(len);
if (data == NULL)
{
- perror("Malloc");
+ perror("OPENSSL_malloc");
goto end;
}
l=BN_bn2bin(dh->p,data);
@@ -285,7 +285,7 @@ bad:
printf("\tif ((dh->p == NULL) || (dh->g == NULL))\n");
printf("\t\treturn(NULL);\n");
printf("\treturn(dh);\n\t}\n");
- Free(data);
+ OPENSSL_free(data);
}
diff --git a/apps/dhparam.c b/apps/dhparam.c
index 709547ff5e..f570f5f024 100644
--- a/apps/dhparam.c
+++ b/apps/dhparam.c
@@ -432,10 +432,10 @@ bad:
len=BN_num_bytes(dh->p);
bits=BN_num_bits(dh->p);
- data=(unsigned char *)Malloc(len);
+ data=(unsigned char *)OPENSSL_malloc(len);
if (data == NULL)
{
- perror("Malloc");
+ perror("OPENSSL_malloc");
goto end;
}
printf("#ifndef HEADER_DH_H\n"
@@ -472,7 +472,7 @@ bad:
if (dh->length)
printf("\tdh->length = %d;\n", dh->length);
printf("\treturn(dh);\n\t}\n");
- Free(data);
+ OPENSSL_free(data);
}
diff --git a/apps/dsa.c b/apps/dsa.c
index 4977671b8a..842e0c0d15 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -283,8 +283,8 @@ end:
if(in != NULL) BIO_free(in);
if(out != NULL) BIO_free(out);
if(dsa != NULL) DSA_free(dsa);
- if(passin) Free(passin);
- if(passout) Free(passout);
+ if(passin) OPENSSL_free(passin);
+ if(passout) OPENSSL_free(passout);
EXIT(ret);
}
#endif
diff --git a/apps/dsaparam.c b/apps/dsaparam.c
index 4d4e1ad2b5..a15d6ea309 100644
--- a/apps/dsaparam.c
+++ b/apps/dsaparam.c
@@ -260,10 +260,10 @@ bad:
bits_p=BN_num_bits(dsa->p);
bits_q=BN_num_bits(dsa->q);
bits_g=BN_num_bits(dsa->g);
- data=(unsigned char *)Malloc(len+20);
+ data=(unsigned char *)OPENSSL_malloc(len+20);
if (data == NULL)
{
- perror("Malloc");
+ perror("OPENSSL_malloc");
goto end;
}
l=BN_bn2bin(dsa->p,data);
diff --git a/apps/enc.c b/apps/enc.c
index 6531c58c54..49338aca0f 100644
--- a/apps/enc.c
+++ b/apps/enc.c
@@ -343,11 +343,11 @@ bad:
if (verbose) BIO_printf(bio_err,"bufsize=%d\n",bsize);
}
- strbuf=Malloc(SIZE);
- buff=(unsigned char *)Malloc(EVP_ENCODE_LENGTH(bsize));
+ strbuf=OPENSSL_malloc(SIZE);
+ buff=(unsigned char *)OPENSSL_malloc(EVP_ENCODE_LENGTH(bsize));
if ((buff == NULL) || (strbuf == NULL))
{
- BIO_printf(bio_err,"Malloc failure %ld\n",(long)EVP_ENCODE_LENGTH(bsize));
+ BIO_printf(bio_err,"OPENSSL_malloc failure %ld\n",(long)EVP_ENCODE_LENGTH(bsize));
goto end;
}
@@ -581,13 +581,13 @@ bad:
}
end:
ERR_print_errors(bio_err);
- if (strbuf != NULL) Free(strbuf);
- if (buff != NULL) Free(buff);
+ if (strbuf != NULL) OPENSSL_free(strbuf);
+ if (buff != NULL) OPENSSL_free(buff);
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free(out);
if (benc != NULL) BIO_free(benc);
if (b64 != NULL) BIO_free(b64);
- if(pass) Free(pass);
+ if(pass) OPENSSL_free(pass);
EXIT(ret);
}
diff --git a/apps/gendsa.c b/apps/gendsa.c
index b1a1c4fcfa..1937613849 100644
--- a/apps/gendsa.c
+++ b/apps/gendsa.c
@@ -211,7 +211,7 @@ end:
if (in != NULL) BIO_free(in);
if (out != NULL) BIO_free(out);
if (dsa != NULL) DSA_free(dsa);
- if(passout) Free(passout);
+ if(passout) OPENSSL_free(passout);
EXIT(ret);
}
#endif
diff --git a/apps/genrsa.c b/apps/genrsa.c
index 6fe578d69f..4cbccf8456 100644
--- a/apps/genrsa.c
+++ b/apps/genrsa.c
@@ -213,7 +213,7 @@ bad:
err:
if (rsa != NULL) RSA_free(rsa);
if (out != NULL) BIO_free(out);
- if(passout) Free(passout);
+ if(passout) OPENSSL_free(passout);
if (ret != 0)
ERR_print_errors(bio_err);
EXIT(ret);
diff --git a/apps/openssl.c b/apps/openssl.c
index a2a263062d..5f0ffa9fd4 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -201,7 +201,7 @@ end:
config=NULL;
}
if (prog != NULL) lh_free(prog);
- if (arg.data != NULL) Free(arg.data);
+ if (arg.data != NULL) OPENSSL_free(arg.data);
ERR_remove_state(0);
EVP_cleanup();
diff --git a/apps/passwd.c b/apps/passwd.c
index 4650ea503d..e991fefaa5 100644
--- a/apps/passwd.c
+++ b/apps/passwd.c
@@ -200,7 +200,7 @@ int MAIN(int argc, char **argv)
passwd_malloc_size = pw_maxlen + 2;
/* longer than necessary so that we can warn about truncation */
- passwd = passwd_malloc = Malloc(passwd_malloc_size);
+ passwd = passwd_malloc = OPENSSL_malloc(passwd_malloc_size);
if (passwd_malloc == NULL)
goto err;
}
@@ -266,9 +266,9 @@ int MAIN(int argc, char **argv)
err:
ERR_print_errors(bio_err);
if (salt_malloc)
- Free(salt_malloc);
+ OPENSSL_free(salt_malloc);
if (passwd_malloc)
- Free(passwd_malloc);
+ OPENSSL_free(passwd_malloc);
if (in)
BIO_free(in);
if (out)
@@ -399,7 +399,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
{
if (*salt_malloc_p == NULL)
{
- *salt_p = *salt_malloc_p = Malloc(3);
+ *salt_p = *salt_malloc_p = OPENSSL_malloc(3);
if (*salt_malloc_p == NULL)
goto err;
}
@@ -422,7 +422,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p,
if (*salt_malloc_p == NULL)
{
- *salt_p = *salt_malloc_p = Malloc(9);
+ *salt_p = *salt_malloc_p = OPENSSL_malloc(9);
if (*salt_malloc_p == NULL)
goto err;
}
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index a45b2da72f..3f958943b4 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -565,8 +565,8 @@ int MAIN(int argc, char **argv)
#endif
BIO_free(in);
BIO_free(out);
- if(passin) Free(passin);
- if(passout) Free(passout);
+ if(passin) OPENSSL_free(passin);
+ if(passout) OPENSSL_free(passout);
EXIT(ret);
}
@@ -774,7 +774,7 @@ int print_attribs (BIO *out, STACK_OF(X509_ATTRIBUTE) *attrlst, char *name)
value = uni2asc(av->value.bmpstring->data,
av->value.bmpstring->length);
BIO_printf(out, "%s\n", value);
- Free(value);
+ OPENSSL_free(value);
break;
case V_ASN1_OCTET_STRING:
diff --git a/apps/pkcs8.c b/apps/pkcs8.c
index 3e59b74124..b0914cd453 100644
--- a/apps/pkcs8.c
+++ b/apps/pkcs8.c
@@ -254,8 +254,8 @@ int MAIN(int argc, char **argv)
PKCS8_PRIV_KEY_INFO_free (p8inf);
EVP_PKEY_free(pkey);
BIO_free(out);
- if(passin) Free(passin);
- if(passout) Free(passout);
+ if(passin) OPENSSL_free(passin);
+ if(passout) OPENSSL_free(passout);
return (0);
}
@@ -338,8 +338,8 @@ int MAIN(int argc, char **argv)
EVP_PKEY_free(pkey);
BIO_free(out);
BIO_free(in);
- if(passin) Free(passin);
- if(passout) Free(passout);
+ if(passin) OPENSSL_free(passin);
+ if(passout) OPENSSL_free(passout);
return (0);
}
diff --git a/apps/req.c b/apps/req.c
index eb338eeb1b..dd376949fd 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -878,8 +878,8 @@ end:
EVP_PKEY_free(pkey);
X509_REQ_free(req);
X509_free(x509ss);
- if(passargin && passin) Free(passin);
- if(passargout && passout) Free(passout);
+ if(passargin && passin) OPENSSL_free(passin);
+ if(passargout && passout) OPENSSL_free(passout);
OBJ_cleanup();
#ifndef NO_DSA
if (dsa_params != NULL) DSA_free(dsa_params);
diff --git a/apps/rsa.c b/apps/rsa.c
index 9d4c2e6564..1269f65703 100644
--- a/apps/rsa.c
+++ b/apps/rsa.c
@@ -345,15 +345,15 @@ bad:
i=1;
size=i2d_Netscape_RSA(rsa,NULL,NULL);
- if ((p=(unsigned char *)Malloc(size)) == NULL)
+ if ((p=(unsigned char *)OPENSSL_malloc(size)) == NULL)
{
- BIO_printf(bio_err,"Malloc failure\n");
+ BIO_printf(bio_err,"Memory allocation failure\n");
goto end;
}
pp=p;
i2d_Netscape_RSA(rsa,&p,NULL);
BIO_write(out,(char *)pp,size);
- Free(pp);
+ OPENSSL_free(pp);
}
#endif
else if (outformat == FORMAT_PEM) {
@@ -376,8 +376,8 @@ end:
if(in != NULL) BIO_free(in);
if(out != NULL) BIO_free(out);
if(rsa != NULL) RSA_free(rsa);
- if(passin) Free(passin);
- if(passout) Free(passout);
+ if(passin) OPENSSL_free(passin);
+ if(passout) OPENSSL_free(passout);
EXIT(ret);
}
#else /* !NO_RSA */
diff --git a/apps/s_client.c b/apps/s_client.c
index 277417efd8..c93531718a 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -201,8 +201,8 @@ int MAIN(int argc, char **argv)
if (bio_err == NULL)
bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
- if ( ((cbuf=Malloc(BUFSIZZ)) == NULL) ||
- ((sbuf=Malloc(BUFSIZZ)) == NULL))
+ if ( ((cbuf=OPENSSL_malloc(BUFSIZZ)) == NULL) ||
+ ((sbuf=OPENSSL_malloc(BUFSIZZ)) == NULL))
{
BIO_printf(bio_err,"out of memory\n");
goto end;
@@ -753,8 +753,8 @@ end:
if (con != NULL) SSL_free(con);
if (con2 != NULL) SSL_free(con2);
if (ctx != NULL) SSL_CTX_free(ctx);
- if (cbuf != NULL) { memset(cbuf,0,BUFSIZZ); Free(cbuf); }
- if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); Free(sbuf); }
+ if (cbuf != NULL) { memset(cbuf,0,BUFSIZZ); OPENSSL_free(cbuf); }
+ if (sbuf != NULL) { memset(sbuf,0,BUFSIZZ); OPENSSL_free(sbuf); }
if (bio_c_out != NULL)
{
BIO_free(bio_c_out);
diff --git a/apps/s_server.c b/apps/s_server.c
index af19b89227..b593283256 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -285,7 +285,7 @@ static int ebcdic_new(BIO *bi)
{
EBCDIC_OUTBUFF *wbuf;
- wbuf = (EBCDIC_OUTBUFF *)Malloc(sizeof(EBCDIC_OUTBUFF) + 1024);
+ wbuf = (EBCDIC_OUTBUFF *)OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + 1024);
wbuf->alloced = 1024;
wbuf->buff[0] = '\0';
@@ -299,7 +299,7 @@ static int ebcdic_free(BIO *a)
{
if (a == NULL) return(0);
if (a->ptr != NULL)
- Free(a->ptr);
+ OPENSSL_free(a->ptr);
a->ptr=NULL;
a->init=0;
a->flags=0;
@@ -336,8 +336,8 @@ static int ebcdic_write(BIO *b, char *in, int inl)
num = num + num; /* double the size */
if (num < inl)
num = inl;
- Free(wbuf);
- wbuf=(EBCDIC_OUTBUFF *)Malloc(sizeof(EBCDIC_OUTBUFF) + num);
+ OPENSSL_free(wbuf);
+ wbuf=(EBCDIC_OUTBUFF *)OPENSSL_malloc(sizeof(EBCDIC_OUTBUFF) + num);
wbuf->alloced = num;
wbuf->buff[0] = '\0';
@@ -766,7 +766,7 @@ static int sv_body(char *hostname, int s, unsigned char *context)
struct timeval tv;
#endif
- if ((buf=Malloc(bufsize)) == NULL)
+ if ((buf=OPENSSL_malloc(bufsize)) == NULL)
{
BIO_printf(bio_err,"out of memory\n");
goto err;
@@ -1028,7 +1028,7 @@ err:
if (buf != NULL)
{
memset(buf,0,bufsize);
- Free(buf);
+ OPENSSL_free(buf);
}
if (ret >= 0)
BIO_printf(bio_s_out,"ACCEPT\n");
@@ -1145,7 +1145,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
BIO *io,*ssl_bio,*sbio;
long total_bytes;
- buf=Malloc(bufsize);
+ buf=OPENSSL_malloc(bufsize);
if (buf == NULL) return(0);
io=BIO_new(BIO_f_buffer());
ssl_bio=BIO_new(BIO_f_ssl());
@@ -1474,7 +1474,7 @@ err:
if (ret >= 0)
BIO_printf(bio_s_out,"ACCEPT\n");
- if (buf != NULL) Free(buf);
+ if (buf != NULL) OPENSSL_free(buf);
if (io != NULL) BIO_free_all(io);
/* if (ssl_bio != NULL) BIO_free(ssl_bio);*/
return(ret);
diff --git a/apps/s_socket.c b/apps/s_socket.c
index 081b1a57d1..0238566a81 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -241,7 +241,7 @@ int do_server(int port, int *ret, int (*cb)(), char *context)
return(0);
}
i=(*cb)(name,sock, context);
- if (name != NULL) Free(name);
+ if (name != NULL) OPENSSL_free(name);
SHUTDOWN2(sock);
if (i < 0)
{
@@ -372,9 +372,9 @@ redoit:
}
else
{
- if ((*host=(char *)Malloc(strlen(h1->h_name)+1)) == NULL)
+ if ((*host=(char *)OPENSSL_malloc(strlen(h1->h_name)+1)) == NULL)
{
- perror("Malloc");
+ perror("OPENSSL_malloc");
return(0);
}
strcpy(*host,h1->h_name);
diff --git a/apps/smime.c b/apps/smime.c
index 7dc66d6ecd..e2fc828737 100644
--- a/apps/smime.c
+++ b/apps/smime.c
@@ -443,7 +443,7 @@ end:
BIO_free(in);
BIO_free(indata);
BIO_free(out);
- if(passin) Free(passin);
+ if(passin) OPENSSL_free(passin);
return (ret);
}
diff --git a/apps/speed.c b/apps/speed.c
index f7a8e00a8b..163d5237c2 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -362,7 +362,7 @@ int MAIN(int argc, char **argv)
rsa_key[i]=NULL;
#endif
- if ((buf=(unsigned char *)Malloc((int)BUFSIZE)) == NULL)
+ if ((buf=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
{
BIO_printf(bio_err,"out of memory\n");
goto end;
@@ -370,7 +370,7 @@ int MAIN(int argc, char **argv)
#ifndef NO_DES
buf_as_des_cblock = (des_cblock *)buf;
#endif
- if ((buf2=(unsigned char *)Malloc((int)BUFSIZE)) == NULL)
+ if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)
{
BIO_printf(bio_err,"out of memory\n");
goto end;
@@ -1173,8 +1173,8 @@ int MAIN(int argc, char **argv)
#endif
mret=0;
end:
- if (buf != NULL) Free(buf);
- if (buf2 != NULL) Free(buf2);
+ if (buf != NULL) OPENSSL_free(buf);
+ if (buf2 != NULL) OPENSSL_free(buf2);
#ifndef NO_RSA
for (i=0; i<RSA_NUM; i++)
if (rsa_key[i] != NULL)
diff --git a/apps/spkac.c b/apps/spkac.c
index f3ee7e34e3..ad45c2ddb7 100644
--- a/apps/spkac.c
+++ b/apps/spkac.c
@@ -200,7 +200,7 @@ bad:
goto end;
}
BIO_printf(out, "SPKAC=%s\n", spkstr);
- Free(spkstr);
+ OPENSSL_free(spkstr);
ret = 0;
goto end;
}
@@ -271,6 +271,6 @@ end:
BIO_free(out);
BIO_free(key);
EVP_PKEY_free(pkey);
- if(passin) Free(passin);
+ if(passin) OPENSSL_free(passin);
EXIT(ret);
}
diff --git a/apps/x509.c b/apps/x509.c
index 0184c62bb2..88ef1e064d 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -696,7 +696,7 @@ bad:
BIO_printf(STDout,"/* issuer :%s */\n",buf);
z=i2d_X509(x,NULL);
- m=Malloc(z);
+ m=OPENSSL_malloc(z);
d=(unsigned char *)m;
z=i2d_X509_NAME(X509_get_subject_name(x),&d);
@@ -734,7 +734,7 @@ bad:
if (y%16 != 0) BIO_printf(STDout,"\n");
BIO_printf(STDout,"};\n");
- Free(m);
+ OPENSSL_free(m);
}
else if (text == i)
{
@@ -917,7 +917,7 @@ end:
X509_REQ_free(rq);
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);
sk_ASN1_OBJECT_pop_free(reject, ASN1_OBJECT_free);
- if(passin) Free(passin);
+ if(passin) OPENSSL_free(passin);
EXIT(ret);
}
@@ -939,7 +939,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
EVP_PKEY_free(upkey);
X509_STORE_CTX_init(&xsc,ctx,x,NULL);
- buf=Malloc(EVP_PKEY_size(pkey)*2+
+ buf=OPENSSL_malloc(EVP_PKEY_size(pkey)*2+
((serialfile == NULL)
?(strlen(CAfile)+strlen(POSTFIX)+1)
:(strlen(serialfile)))+1);
@@ -1062,7 +1062,7 @@ end:
X509_STORE_CTX_cleanup(&xsc);
if (!ret)
ERR_print_errors(bio_err);
- if (buf != NULL) Free(buf);
+ if (buf != NULL) OPENSSL_free(buf);
if (bs != NULL) ASN1_INTEGER_free(bs);
if (io != NULL) BIO_free(io);
if (serial != NULL) BN_free(serial);