diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/protocols/tls.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/protocols/tls.c b/src/lib/protocols/tls.c index b70538949..1b120dc7b 100644 --- a/src/lib/protocols/tls.c +++ b/src/lib/protocols/tls.c @@ -392,8 +392,10 @@ int processCertificate(struct ndpi_detection_module_struct *ndpi_struct, if((packet->payload[4] != 0x0) || ((certificates_length+3) != length)) return(-2); /* Invalid length */ - if((flow->l4.tcp.tls.srv_cert_fingerprint_ctx = (void*)ndpi_malloc(sizeof(SHA1_CTX))) == NULL) - return(-3); /* Not enough memory */ + if(!flow->l4.tcp.tls.srv_cert_fingerprint_ctx) { + if((flow->l4.tcp.tls.srv_cert_fingerprint_ctx = (void*)ndpi_malloc(sizeof(SHA1_CTX))) == NULL) + return(-3); /* Not enough memory */ + } /* Now let's process each individual certificates */ while(certificates_offset < certificates_length) { |