Replace an unneeded OPENSSL_malloc call.

This commit is contained in:
Jon Siwek 2014-05-02 12:49:53 -05:00
parent 3905b6fc70
commit b15bbf4f33
3 changed files with 7 additions and 5 deletions

View file

@ -1,4 +1,8 @@
2.2-410 | 2014-05-02 12:49:53 -0500
* Replace an unneeded OPENSSL_malloc call. (Jon Siwek)
2.2-409 | 2014-05-02 12:09:06 -0500 2.2-409 | 2014-05-02 12:09:06 -0500
* Clean up and documentation for base SNMP script. (Jon Siwek) * Clean up and documentation for base SNMP script. (Jon Siwek)

View file

@ -1 +1 @@
2.2-409 2.2-410

View file

@ -180,9 +180,7 @@ StringVal* file_analysis::X509::GetExtensionFromBIO(BIO* bio)
return new StringVal(""); return new StringVal("");
} }
// TODO: see about using regular malloc here, there were unknown problems char* buffer = (char*) malloc(length);
// using anything other than OPENSSL_malloc that need investigation.
char* buffer = (char*) OPENSSL_malloc(length);
if ( ! buffer ) if ( ! buffer )
{ {
@ -196,7 +194,7 @@ StringVal* file_analysis::X509::GetExtensionFromBIO(BIO* bio)
BIO_read(bio, (void*) buffer, length); BIO_read(bio, (void*) buffer, length);
StringVal* ext_val = new StringVal(length, buffer); StringVal* ext_val = new StringVal(length, buffer);
OPENSSL_free(buffer); free(buffer);
BIO_free_all(bio); BIO_free_all(bio);
return ext_val; return ext_val;