mirror of
https://github.com/adulau/ssldump.git
synced 2024-11-24 18:37:05 +00:00
Avoid some memory leaks
This commit is contained in:
parent
b2577013f6
commit
cf23a39e3b
2 changed files with 4 additions and 1 deletions
|
@ -301,7 +301,9 @@ static int destroy_ssl_analyzer(objp)
|
||||||
free_r_queue(obj->r2i_queue);
|
free_r_queue(obj->r2i_queue);
|
||||||
ssl_decoder_destroy(&obj->decoder);
|
ssl_decoder_destroy(&obj->decoder);
|
||||||
free(obj->client_name);
|
free(obj->client_name);
|
||||||
|
free(obj->client_ip);
|
||||||
free(obj->server_name);
|
free(obj->server_name);
|
||||||
|
free(obj->server_ip);
|
||||||
free(obj->extensions);
|
free(obj->extensions);
|
||||||
free(*objp);
|
free(*objp);
|
||||||
*objp=0;
|
*objp=0;
|
||||||
|
|
|
@ -96,6 +96,7 @@ int sslx_print_certificate(ssl,data,pf)
|
||||||
|
|
||||||
EVP_EncodeBlock((unsigned char *)b64_cert, d, data->len);
|
EVP_EncodeBlock((unsigned char *)b64_cert, d, data->len);
|
||||||
json_object_object_add(cert_obj, "cert_der", json_object_new_string(b64_cert));
|
json_object_object_add(cert_obj, "cert_der", json_object_new_string(b64_cert));
|
||||||
|
free(b64_cert);
|
||||||
|
|
||||||
if(!(x=d2i_X509(0,(const unsigned char **) &d,data->len))){
|
if(!(x=d2i_X509(0,(const unsigned char **) &d,data->len))){
|
||||||
explain(ssl,"Bad certificate");
|
explain(ssl,"Bad certificate");
|
||||||
|
@ -122,7 +123,7 @@ int sslx_print_certificate(ssl,data,pf)
|
||||||
INIT_DATA(data_tmp,a->data,a->length);
|
INIT_DATA(data_tmp,a->data,a->length);
|
||||||
exstr(ssl, serial_str, &data_tmp);
|
exstr(ssl, serial_str, &data_tmp);
|
||||||
json_object_object_add(cert_obj, "cert_serial", json_object_new_string(serial_str));
|
json_object_object_add(cert_obj, "cert_serial", json_object_new_string(serial_str));
|
||||||
|
free(serial_str);
|
||||||
sslx__print_serial(ssl,a);
|
sslx__print_serial(ssl,a);
|
||||||
|
|
||||||
ext=X509_get_ext_count(x);
|
ext=X509_get_ext_count(x);
|
||||||
|
|
Loading…
Reference in a new issue