Minor fixes

This commit is contained in:
Luca Deri
2020-01-21 20:52:42 +01:00
parent 931f51bd77
commit 5a40f9b7fd
3 changed files with 448 additions and 447 deletions
+7 -6
View File
@@ -467,11 +467,12 @@ ndpi_classify (const unsigned short *pkt_len, const struct timeval *pkt_time,
features[i] = 0.0; features[i] = 0.0;
} }
merged_lens = calloc(1, sizeof(uint16_t)*(op_n + ip_n)); merged_lens = ndpi_calloc(1, sizeof(uint16_t)*(op_n + ip_n));
merged_times = calloc(1, sizeof(uint16_t)*(op_n + ip_n)); merged_times = ndpi_calloc(1, sizeof(uint16_t)*(op_n + ip_n));
if(!merged_lens || !merged_times) { if(!merged_lens || !merged_times) {
free(merged_lens); ndpi_free(merged_lens);
free(merged_times); ndpi_free(merged_times);
return(score); return(score);
} }
@@ -529,8 +530,8 @@ ndpi_classify (const unsigned short *pkt_len, const struct timeval *pkt_time,
score = min(-score,500.0); // check b/c overflow score = min(-score,500.0); // check b/c overflow
free(merged_lens); ndpi_free(merged_lens);
free(merged_times); ndpi_free(merged_times);
return 1.0/(1.0+exp(score)); return 1.0/(1.0+exp(score));
} }
+1 -1
View File
@@ -322,7 +322,7 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct,
/* We set the protocol in the response */ /* We set the protocol in the response */
if(flow->kerberos_buf.pktbuf != NULL) { if(flow->kerberos_buf.pktbuf != NULL) {
free(flow->kerberos_buf.pktbuf); ndpi_free(flow->kerberos_buf.pktbuf);
flow->kerberos_buf.pktbuf = NULL; flow->kerberos_buf.pktbuf = NULL;
} }
+1 -1
View File
@@ -341,7 +341,7 @@ static void ndpi_search_ssh_tcp(struct ndpi_detection_module_struct *ndpi_struct
flow->protos.ssh.hassh_server[32] = '\0'; flow->protos.ssh.hassh_server[32] = '\0';
} }
free(hassh_buf); ndpi_free(hassh_buf);
} }
ndpi_int_ssh_add_connection(ndpi_struct, flow); ndpi_int_ssh_add_connection(ndpi_struct, flow);