aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-07-13 10:53:25 +0200
committerLuca Deri <deri@ntop.org>2020-07-13 10:53:25 +0200
commit802254327a71cc3103784579911db86b12d3918e (patch)
tree0505f48739c2e15e46275130404f9b0be4fa5b6c
parent9d8717a0c7a9bdddb4830f69da58d0dba4b425e2 (diff)
wrapper cleanup
-rw-r--r--example/ndpiReader.c96
-rw-r--r--example/reader_util.c42
2 files changed, 69 insertions, 69 deletions
diff --git a/example/ndpiReader.c b/example/ndpiReader.c
index faf5d5508..b8695f5c2 100644
--- a/example/ndpiReader.c
+++ b/example/ndpiReader.c
@@ -532,7 +532,7 @@ void extcap_config() {
printf("arg {number=%d}{call=-i}{display=Pcap File to Analyze}{type=fileselect}"
"{tooltip=The pcap file to analyze (if the interface is unspecified)}\n", argidx++);
- protos = (struct ndpi_proto_sorter*)malloc(sizeof(struct ndpi_proto_sorter) * ndpi_num_supported_protocols);
+ protos = (struct ndpi_proto_sorter*)ndpi_malloc(sizeof(struct ndpi_proto_sorter) * ndpi_num_supported_protocols);
if(!protos) exit(0);
for(i=0; i<(int) ndpi_num_supported_protocols; i++) {
@@ -551,7 +551,7 @@ void extcap_config() {
printf("value {arg=%d}{value=%d}{display=%s (%d)}\n", argidx, protos[i].id,
protos[i].name, protos[i].id);
- free(protos);
+ ndpi_free(protos);
exit(0);
}
@@ -746,13 +746,13 @@ static void parseOptions(int argc, char **argv) {
if(nDPI_LogLevel < 0) nDPI_LogLevel = 0;
if(nDPI_LogLevel > 3) {
nDPI_LogLevel = 3;
- free(_debug_protocols);
+ ndpi_free(_debug_protocols);
_debug_protocols = strdup("all");
}
break;
case 'u':
- free(_debug_protocols);
+ ndpi_free(_debug_protocols);
_debug_protocols = strdup(optarg);
break;
@@ -831,7 +831,7 @@ static void parseOptions(int argc, char **argv) {
case '8':
nDPI_LogLevel = NDPI_LOG_DEBUG_EXTRA;
- free(_debug_protocols);
+ ndpi_free(_debug_protocols);
_debug_protocols = strdup("all");
break;
@@ -1436,17 +1436,17 @@ void updateScanners(struct single_flow_info **scanners, u_int32_t saddr,
HASH_FIND_INT(*scanners, (int *)&saddr, f);
if(f == NULL) {
- f = (struct single_flow_info*)malloc(sizeof(struct single_flow_info));
+ f = (struct single_flow_info*)ndpi_malloc(sizeof(struct single_flow_info));
if(!f) return;
f->saddr = saddr;
f->version = version;
f->tot_flows = 1;
f->ports = NULL;
- p = (struct port_flow_info*)malloc(sizeof(struct port_flow_info));
+ p = (struct port_flow_info*)ndpi_malloc(sizeof(struct port_flow_info));
if(!p) {
- free(f);
+ ndpi_free(f);
return;
} else
p->port = dport, p->num_flows = 1;
@@ -1460,7 +1460,7 @@ void updateScanners(struct single_flow_info **scanners, u_int32_t saddr,
HASH_FIND_INT(f->ports, (int *)&dport, pp);
if(pp == NULL) {
- pp = (struct port_flow_info*)malloc(sizeof(struct port_flow_info));
+ pp = (struct port_flow_info*)ndpi_malloc(sizeof(struct port_flow_info));
if(!pp) return;
pp->port = dport, pp->num_flows = 1;
@@ -1492,7 +1492,7 @@ int updateIpTree(u_int32_t key, u_int8_t version,
&(*rootp)->right; /* T4: follow right branch */
}
- q = (addr_node *) malloc(sizeof(addr_node)); /* T5: key not found */
+ q = (addr_node *) ndpi_malloc(sizeof(addr_node)); /* T5: key not found */
if(q != (addr_node *)0) { /* make new node */
*rootp = q; /* link new node to old */
@@ -1515,7 +1515,7 @@ void freeIpTree(addr_node *root) {
freeIpTree(root->left);
freeIpTree(root->right);
- free(root);
+ ndpi_free(root);
}
/* *********************************************** */
@@ -1575,7 +1575,7 @@ static void updatePortStats(struct port_stats **stats, u_int32_t port,
HASH_FIND_INT(*stats, &port, s);
if(s == NULL) {
- s = (struct port_stats*)calloc(1, sizeof(struct port_stats));
+ s = (struct port_stats*)ndpi_calloc(1, sizeof(struct port_stats));
if(!s) return;
s->port = port, s->num_pkts = num_pkts, s->num_bytes = num_bytes;
@@ -1583,9 +1583,9 @@ static void updatePortStats(struct port_stats **stats, u_int32_t port,
updateTopIpAddress(addr, version, proto, 1, s->top_ip_addrs, MAX_NUM_IP_ADDRESS);
- s->addr_tree = (addr_node *) malloc(sizeof(addr_node));
+ s->addr_tree = (addr_node *) ndpi_malloc(sizeof(addr_node));
if(!s->addr_tree) {
- free(s);
+ ndpi_free(s);
return;
}
@@ -1657,7 +1657,7 @@ static struct receiver *cutBackTo(struct receiver **rcvrs, u_int32_t size, u_int
if(i++ == count)
return r;
HASH_DEL(*rcvrs, r);
- free(r);
+ ndpi_free(r);
}
return(NULL);
@@ -1676,7 +1676,7 @@ static void mergeTables(struct receiver **primary, struct receiver **secondary)
HASH_ITER(hh, *primary, r, tmp) {
HASH_FIND_INT(*secondary, (int *)&(r->addr), s);
if(s == NULL){
- s = (struct receiver *)malloc(sizeof(struct receiver));
+ s = (struct receiver *)ndpi_malloc(sizeof(struct receiver));
if(!s) return;
s->addr = r->addr;
@@ -1689,7 +1689,7 @@ static void mergeTables(struct receiver **primary, struct receiver **secondary)
s->num_pkts += r->num_pkts;
HASH_DEL(*primary, r);
- free(r);
+ ndpi_free(r);
}
}
/* *********************************************** */
@@ -1699,7 +1699,7 @@ static void deleteReceivers(struct receiver *rcvrs) {
HASH_ITER(hh, rcvrs, current, tmp) {
HASH_DEL(rcvrs, current);
- free(current);
+ ndpi_free(current);
}
}
@@ -1729,7 +1729,7 @@ static void updateReceivers(struct receiver **rcvrs, u_int32_t dst_addr,
if(r == NULL) {
if(((size = HASH_COUNT(*rcvrs)) < MAX_TABLE_SIZE_1)
|| ((a = acceptable(num_pkts)) != 0)){
- r = (struct receiver *)malloc(sizeof(struct receiver));
+ r = (struct receiver *)ndpi_malloc(sizeof(struct receiver));
if(!r) return;
r->addr = dst_addr;
@@ -1766,10 +1766,10 @@ static void deleteScanners(struct single_flow_info *scanners) {
HASH_ITER(hh, scanners, s, tmp) {
HASH_ITER(hh, s->ports, p, tmp2) {
if(s->ports) HASH_DEL(s->ports, p);
- free(p);
+ ndpi_free(p);
}
HASH_DEL(scanners, s);
- free(s);
+ ndpi_free(s);
}
}
@@ -1781,7 +1781,7 @@ static void deletePortsStats(struct port_stats *stats) {
HASH_ITER(hh, stats, current_port, tmp) {
HASH_DEL(stats, current_port);
freeIpTree(current_port->addr_tree);
- free(current_port);
+ ndpi_free(current_port);
}
}
@@ -2109,7 +2109,7 @@ static void printFlowsStats() {
for(thread_id = 0; thread_id < num_threads; thread_id++)
total_flows += ndpi_thread_info[thread_id].workflow->num_allocated_flows;
- if((all_flows = (struct flow_info*)malloc(sizeof(struct flow_info)*total_flows)) == NULL) {
+ if((all_flows = (struct flow_info*)ndpi_malloc(sizeof(struct flow_info)*total_flows)) == NULL) {
fprintf(out, "Fatal error: not enough memory\n");
exit(-1);
}
@@ -2148,14 +2148,14 @@ static void printFlowsStats() {
//host ip -> ja3
if(ja3ByHostFound == NULL){
//adding the new host
- ndpi_host_ja3_fingerprints *newHost = malloc(sizeof(ndpi_host_ja3_fingerprints));
+ ndpi_host_ja3_fingerprints *newHost = ndpi_malloc(sizeof(ndpi_host_ja3_fingerprints));
newHost->host_client_info_hasht = NULL;
newHost->host_server_info_hasht = NULL;
newHost->ip_string = all_flows[i].flow->src_name;
newHost->ip = all_flows[i].flow->src_ip;
newHost->dns_name = all_flows[i].flow->ssh_tls.client_requested_server_name;
- ndpi_ja3_info *newJA3 = malloc(sizeof(ndpi_ja3_info));
+ ndpi_ja3_info *newJA3 = ndpi_malloc(sizeof(ndpi_ja3_info));
newJA3->ja3 = all_flows[i].flow->ssh_tls.ja3_client;
newJA3->unsafe_cipher = all_flows[i].flow->ssh_tls.client_unsafe_cipher;
//adding the new ja3 fingerprint
@@ -2171,7 +2171,7 @@ static void printFlowsStats() {
all_flows[i].flow->ssh_tls.ja3_client, infoFound);
if(infoFound == NULL){
- ndpi_ja3_info *newJA3 = malloc(sizeof(ndpi_ja3_info));
+ ndpi_ja3_info *newJA3 = ndpi_malloc(sizeof(ndpi_ja3_info));
newJA3->ja3 = all_flows[i].flow->ssh_tls.ja3_client;
newJA3->unsafe_cipher = all_flows[i].flow->ssh_tls.client_unsafe_cipher;
HASH_ADD_KEYPTR(hh, ja3ByHostFound->host_client_info_hasht,
@@ -2182,13 +2182,13 @@ static void printFlowsStats() {
//ja3 -> host ip
HASH_FIND_STR(hostByJA3C_ht, all_flows[i].flow->ssh_tls.ja3_client, hostByJA3Found);
if(hostByJA3Found == NULL){
- ndpi_ip_dns *newHost = malloc(sizeof(ndpi_ip_dns));
+ ndpi_ip_dns *newHost = ndpi_malloc(sizeof(ndpi_ip_dns));
newHost->ip = all_flows[i].flow->src_ip;
newHost->ip_string = all_flows[i].flow->src_name;
newHost->dns_name = all_flows[i].flow->ssh_tls.client_requested_server_name;;
- ndpi_ja3_fingerprints_host *newElement = malloc(sizeof(ndpi_ja3_fingerprints_host));
+ ndpi_ja3_fingerprints_host *newElement = ndpi_malloc(sizeof(ndpi_ja3_fingerprints_host));
newElement->ja3 = all_flows[i].flow->ssh_tls.ja3_client;
newElement->unsafe_cipher = all_flows[i].flow->ssh_tls.client_unsafe_cipher;
newElement->ipToDNS_ht = NULL;
@@ -2200,7 +2200,7 @@ static void printFlowsStats() {
ndpi_ip_dns *innerElement = NULL;
HASH_FIND_INT(hostByJA3Found->ipToDNS_ht, &(all_flows[i].flow->src_ip), innerElement);
if(innerElement == NULL){
- ndpi_ip_dns *newInnerElement = malloc(sizeof(ndpi_ip_dns));
+ ndpi_ip_dns *newInnerElement = ndpi_malloc(sizeof(ndpi_ip_dns));
newInnerElement->ip = all_flows[i].flow->src_ip;
newInnerElement->ip_string = all_flows[i].flow->src_name;
newInnerElement->dns_name = all_flows[i].flow->ssh_tls.client_requested_server_name;
@@ -2214,14 +2214,14 @@ static void printFlowsStats() {
HASH_FIND_INT(ja3ByHostsHashT, &(all_flows[i].flow->dst_ip), ja3ByHostFound);
if(ja3ByHostFound == NULL){
//adding the new host in the hash table
- ndpi_host_ja3_fingerprints *newHost = malloc(sizeof(ndpi_host_ja3_fingerprints));
+ ndpi_host_ja3_fingerprints *newHost = ndpi_malloc(sizeof(ndpi_host_ja3_fingerprints));
newHost->host_client_info_hasht = NULL;
newHost->host_server_info_hasht = NULL;
newHost->ip_string = all_flows[i].flow->dst_name;
newHost->ip = all_flows[i].flow->dst_ip;
newHost->dns_name = all_flows[i].flow->ssh_tls.server_info;
- ndpi_ja3_info *newJA3 = malloc(sizeof(ndpi_ja3_info));
+ ndpi_ja3_info *newJA3 = ndpi_malloc(sizeof(ndpi_ja3_info));
newJA3->ja3 = all_flows[i].flow->ssh_tls.ja3_server;
newJA3->unsafe_cipher = all_flows[i].flow->ssh_tls.server_unsafe_cipher;
//adding the new ja3 fingerprint
@@ -2235,7 +2235,7 @@ static void printFlowsStats() {
HASH_FIND_STR(ja3ByHostFound->host_server_info_hasht,
all_flows[i].flow->ssh_tls.ja3_server, infoFound);
if(infoFound == NULL){
- ndpi_ja3_info *newJA3 = malloc(sizeof(ndpi_ja3_info));
+ ndpi_ja3_info *newJA3 = ndpi_malloc(sizeof(ndpi_ja3_info));
newJA3->ja3 = all_flows[i].flow->ssh_tls.ja3_server;
newJA3->unsafe_cipher = all_flows[i].flow->ssh_tls.server_unsafe_cipher;
HASH_ADD_KEYPTR(hh, ja3ByHostFound->host_server_info_hasht,
@@ -2245,13 +2245,13 @@ static void printFlowsStats() {
HASH_FIND_STR(hostByJA3S_ht, all_flows[i].flow->ssh_tls.ja3_server, hostByJA3Found);
if(hostByJA3Found == NULL){
- ndpi_ip_dns *newHost = malloc(sizeof(ndpi_ip_dns));
+ ndpi_ip_dns *newHost = ndpi_malloc(sizeof(ndpi_ip_dns));
newHost->ip = all_flows[i].flow->dst_ip;
newHost->ip_string = all_flows[i].flow->dst_name;
newHost->dns_name = all_flows[i].flow->ssh_tls.server_info;;
- ndpi_ja3_fingerprints_host *newElement = malloc(sizeof(ndpi_ja3_fingerprints_host));
+ ndpi_ja3_fingerprints_host *newElement = ndpi_malloc(sizeof(ndpi_ja3_fingerprints_host));
newElement->ja3 = all_flows[i].flow->ssh_tls.ja3_server;
newElement->unsafe_cipher = all_flows[i].flow->ssh_tls.server_unsafe_cipher;
newElement->ipToDNS_ht = NULL;
@@ -2264,7 +2264,7 @@ static void printFlowsStats() {
HASH_FIND_INT(hostByJA3Found->ipToDNS_ht, &(all_flows[i].flow->dst_ip), innerElement);
if(innerElement == NULL){
- ndpi_ip_dns *newInnerElement = malloc(sizeof(ndpi_ip_dns));
+ ndpi_ip_dns *newInnerElement = ndpi_malloc(sizeof(ndpi_ip_dns));
newInnerElement->ip = all_flows[i].flow->dst_ip;
newInnerElement->ip_string = all_flows[i].flow->dst_name;
newInnerElement->dns_name = all_flows[i].flow->ssh_tls.server_info;
@@ -2419,25 +2419,25 @@ static void printFlowsStats() {
HASH_ITER(hh, ja3ByHost_element->host_client_info_hasht, info_of_element, tmp2) {
if(ja3ByHost_element->host_client_info_hasht)
HASH_DEL(ja3ByHost_element->host_client_info_hasht, info_of_element);
- free(info_of_element);
+ ndpi_free(info_of_element);
}
HASH_ITER(hh, ja3ByHost_element->host_server_info_hasht, info_of_element, tmp2) {
if(ja3ByHost_element->host_server_info_hasht)
HASH_DEL(ja3ByHost_element->host_server_info_hasht, info_of_element);
- free(info_of_element);
+ ndpi_free(info_of_element);
}
HASH_DEL(ja3ByHostsHashT, ja3ByHost_element);
- free(ja3ByHost_element);
+ ndpi_free(ja3ByHost_element);
}
HASH_ITER(hh, hostByJA3C_ht, hostByJA3Element, tmp3) {
HASH_ITER(hh, hostByJA3C_ht->ipToDNS_ht, innerHashEl, tmp4) {
if(hostByJA3Element->ipToDNS_ht)
HASH_DEL(hostByJA3Element->ipToDNS_ht, innerHashEl);
- free(innerHashEl);
+ ndpi_free(innerHashEl);
}
HASH_DEL(hostByJA3C_ht, hostByJA3Element);
- free(hostByJA3Element);
+ ndpi_free(hostByJA3Element);
}
hostByJA3Element = NULL;
@@ -2445,10 +2445,10 @@ static void printFlowsStats() {
HASH_ITER(hh, hostByJA3S_ht->ipToDNS_ht, innerHashEl, tmp4) {
if(hostByJA3Element->ipToDNS_ht)
HASH_DEL(hostByJA3Element->ipToDNS_ht, innerHashEl);
- free(innerHashEl);
+ ndpi_free(innerHashEl);
}
HASH_DEL(hostByJA3S_ht, hostByJA3Element);
- free(hostByJA3Element);
+ ndpi_free(hostByJA3Element);
}
}
}
@@ -2568,7 +2568,7 @@ static void printFlowsStats() {
printFlow(i+1, all_flows[i].flow, all_flows[i].thread_id);
}
- free(all_flows);
+ ndpi_free(all_flows);
}
/* *********************************************** */
@@ -2941,7 +2941,7 @@ static void ndpi_process_packet(u_char *args,
u_int16_t thread_id = *((u_int16_t*)args);
/* allocate an exact size buffer to check overflows */
- uint8_t *packet_checked = malloc(header->caplen);
+ uint8_t *packet_checked = ndpi_malloc(header->caplen);
if(packet_checked == NULL){
return ;
@@ -3051,7 +3051,7 @@ static void ndpi_process_packet(u_char *args,
is called above by printResults()
*/
if(packet_checked){
- free(packet_checked);
+ ndpi_free(packet_checked);
packet_checked = NULL;
}
}
@@ -3111,7 +3111,7 @@ void * processing_thread(void *_thread_id) {
gettimeofday(&h.ts, NULL);
ndpi_process_packet((u_char*)&thread_id, &h, (const u_char *)data);
- rte_pktmbuf_free(bufs[i]);
+ rte_pktmbuf_ndpi_free(bufs[i]);
}
}
#else
@@ -3697,13 +3697,13 @@ int orginal_main(int argc, char **argv) {
for(i=0; i<num_loops; i++)
test_lib();
- if(results_path) free(results_path);
+ if(results_path) ndpi_free(results_path);
if(results_file) fclose(results_file);
if(extcap_dumper) pcap_dump_close(extcap_dumper);
if(extcap_fifo_h) pcap_close(extcap_fifo_h);
if(ndpi_info_mod) ndpi_exit_detection_module(ndpi_info_mod);
if(csv_fp) fclose(csv_fp);
- free(_debug_protocols);
+ ndpi_free(_debug_protocols);
return 0;
}
diff --git a/example/reader_util.c b/example/reader_util.c
index 9ad70ea53..e26e8625d 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -139,11 +139,11 @@ void ndpi_analyze_payload(struct ndpi_flow_info *flow,
HASH_FIND(hh, pstats, payload, payload_len, ret);
if(ret == NULL) {
- if((ret = (struct payload_stats*)calloc(1, sizeof(struct payload_stats))) == NULL)
+ if((ret = (struct payload_stats*)ndpi_calloc(1, sizeof(struct payload_stats))) == NULL)
return; /* OOM */
- if((ret->pattern = (u_int8_t*)malloc(payload_len)) == NULL) {
- free(ret);
+ if((ret->pattern = (u_int8_t*)ndpi_malloc(payload_len)) == NULL) {
+ ndpi_free(ret);
return;
}
@@ -163,7 +163,7 @@ void ndpi_analyze_payload(struct ndpi_flow_info *flow,
HASH_FIND_INT(ret->flows, &flow->flow_id, f);
if(f == NULL) {
- if((f = (struct flow_id_stats*)calloc(1, sizeof(struct flow_id_stats))) == NULL)
+ if((f = (struct flow_id_stats*)ndpi_calloc(1, sizeof(struct flow_id_stats))) == NULL)
return; /* OOM */
f->flow_id = flow->flow_id;
@@ -172,7 +172,7 @@ void ndpi_analyze_payload(struct ndpi_flow_info *flow,
HASH_FIND_INT(ret->packets, &packet_id, p);
if(p == NULL) {
- if((p = (struct packet_id_stats*)calloc(1, sizeof(struct packet_id_stats))) == NULL)
+ if((p = (struct packet_id_stats*)ndpi_calloc(1, sizeof(struct packet_id_stats))) == NULL)
return; /* OOM */
p->packet_id = packet_id;
@@ -284,14 +284,14 @@ void ndpi_report_payload_stats() {
if(num <= max_num_reported_top_payloads)
print_payload_stat(p);
- free(p->pattern);
+ ndpi_free(p->pattern);
{
struct flow_id_stats *p1, *tmp1;
HASH_ITER(hh, p->flows, p1, tmp1) {
HASH_DEL(p->flows, p1);
- free(p1);
+ ndpi_free(p1);
}
}
@@ -300,12 +300,12 @@ void ndpi_report_payload_stats() {
HASH_ITER(hh, p->packets, p1, tmp1) {
HASH_DEL(p->packets, p1);
- free(p1);
+ ndpi_free(p1);
}
}
HASH_DEL(pstats, p);
- free(p);
+ ndpi_free(p);
num++;
}
}
@@ -323,15 +323,15 @@ void ndpi_free_flow_info_half(struct ndpi_flow_info *flow) {
extern u_int32_t current_ndpi_memory, max_ndpi_memory;
/**
- * @brief malloc wrapper function
+ * @brief ndpi_malloc wrapper function
*/
-static void *malloc_wrapper(size_t size) {
+static void *ndpi_malloc_wrapper(size_t size) {
current_ndpi_memory += size;
if(current_ndpi_memory > max_ndpi_memory)
max_ndpi_memory = current_ndpi_memory;
- return malloc(size);
+ return(malloc(size)); /* Don't change to ndpi_malloc !!!!! */
}
/* ***************************************************** */
@@ -340,7 +340,7 @@ static void *malloc_wrapper(size_t size) {
* @brief free wrapper function
*/
static void free_wrapper(void *freeable) {
- free(freeable);
+ free(freeable); /* Don't change to ndpi_free !!!!! */
}
/* ***************************************************** */
@@ -411,10 +411,10 @@ struct ndpi_workflow* ndpi_workflow_init(const struct ndpi_workflow_prefs * pref
struct ndpi_detection_module_struct * module;
struct ndpi_workflow * workflow;
- set_ndpi_malloc(malloc_wrapper), set_ndpi_free(free_wrapper);
+ set_ndpi_malloc(ndpi_malloc_wrapper), set_ndpi_free(free_wrapper);
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
- /* TODO: just needed here to init ndpi malloc wrapper */
+ /* TODO: just needed here to init ndpi ndpi_malloc wrapper */
module = ndpi_init_detection_module(ndpi_no_prefs);
if(module == NULL) {
@@ -529,8 +529,8 @@ void ndpi_workflow_free(struct ndpi_workflow * workflow) {
ndpi_tdestroy(workflow->ndpi_flows_root[i], ndpi_flow_info_freer);
ndpi_exit_detection_module(workflow->ndpi_struct);
- free(workflow->ndpi_flows_root);
- free(workflow);
+ ndpi_free(workflow->ndpi_flows_root);
+ ndpi_free(workflow);
}
/* ***************************************************** */
@@ -816,7 +816,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
workflow->prefs.max_ndpi_flows);
exit(-1);
} else {
- struct ndpi_flow_info *newflow = (struct ndpi_flow_info*)malloc(sizeof(struct ndpi_flow_info));
+ struct ndpi_flow_info *newflow = (struct ndpi_flow_info*)ndpi_malloc(sizeof(struct ndpi_flow_info));
if(newflow == NULL) {
LOG(NDPI_LOG_ERROR, "[NDPI] %s(1): not enough memory\n", __FUNCTION__);
@@ -862,7 +862,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
#else
ndpi_free_bin(&newflow->payload_len_bin);
#endif
- free(newflow);
+ ndpi_free(newflow);
return(NULL);
} else
memset(newflow->ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
@@ -874,7 +874,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
#else
ndpi_free_bin(&newflow->payload_len_bin);
#endif
- free(newflow);
+ ndpi_free(newflow);
return(NULL);
} else
memset(newflow->src_id, 0, SIZEOF_ID_STRUCT);
@@ -886,7 +886,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
#else
ndpi_free_bin(&newflow->payload_len_bin);
#endif
- free(newflow);
+ ndpi_free(newflow);
return(NULL);
} else
memset(newflow->dst_id, 0, SIZEOF_ID_STRUCT);