diff --git a/src/NetworkInterface.cpp b/src/NetworkInterface.cpp index 1868ddf0e5..de023ca334 100644 --- a/src/NetworkInterface.cpp +++ b/src/NetworkInterface.cpp @@ -177,7 +177,7 @@ NetworkInterface::NetworkInterface(const char *name) { ndpi_set_protocol_detection_bitmask2(ndpi_struct, &all); last_pkt_rcvd = 0, pollLoopCreated = false, bridge_interface = false; - next_idle_flow_purge = next_idle_host_purge = 0; + next_idle_flow_purge = next_idle_host_purge = 0, antenna_mac = NULL; cpu_affinity = -1 /* no affinity */, has_vlan_packets = false, pkt_dumper = NULL; if(ntop->getPrefs()->are_taps_enabled()) pkt_dumper_tap = new PacketDumperTuntap(this); diff --git a/src/ParserInterface.cpp b/src/ParserInterface.cpp index b65312bee1..8ecee9d854 100755 --- a/src/ParserInterface.cpp +++ b/src/ParserInterface.cpp @@ -63,7 +63,7 @@ ParserInterface::ParserInterface(const char *endpoint) : NetworkInterface(endpoi switch(key_id) { case 0: //json additional object added by Flow::serialize() - if( (additional_o != NULL) && (strcmp(key,"json") == 0) ) { + if((additional_o != NULL) && (strcmp(key,"json") == 0)) { struct json_object_iterator additional_it = json_object_iter_begin(additional_o); struct json_object_iterator additional_itEnd = json_object_iter_end(additional_o); @@ -78,8 +78,6 @@ ParserInterface::ParserInterface(const char *endpoint) : NetworkInterface(endpoi } json_object_iter_next(&additional_it); } - /* Dispose memory */ - json_object_put(additional_o); } break; case IN_SRC_MAC: @@ -216,6 +214,8 @@ ParserInterface::ParserInterface(const char *endpoint) : NetworkInterface(endpoi json_object_object_add(flow.additional_fields, key, json_object_new_string(value)); break; } /* switch */ + + if(additional_o) json_object_put(additional_o); } /* if */ /* Move to the next element */ diff --git a/src/Prefs.cpp b/src/Prefs.cpp index 44441b1f34..fb0ea1ee5a 100755 --- a/src/Prefs.cpp +++ b/src/Prefs.cpp @@ -124,6 +124,7 @@ Prefs::~Prefs() { if(es_type) free(es_type); if(es_index) free(es_index); if(es_url) free(es_url); + if(es_user) free(es_user); if(es_pwd) free(es_pwd); if(communities_file) free(communities_file); free(http_prefix);